home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 989109888

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association pull_request body repo type active_lock_reason performed_via_github_app reactions draft state_reason
989109888 MDU6SXNzdWU5ODkxMDk4ODg= 1460 Override column metadata with metadata from another column 72577720 open 0     0 2021-09-06T12:13:33Z 2021-09-06T12:13:33Z   CONTRIBUTOR  

I have a table from the PUDL project (https://github.com/catalyst-cooperative/pudl) that looks like this:

CREATE TABLE fuel_ferc1 ( id INTEGER NOT NULL, record_id TEXT, utility_id_ferc1 INTEGER, report_year INTEGER, plant_name_ferc1 TEXT, fuel_type_code_pudl VARCHAR(7), fuel_unit VARCHAR(7), fuel_qty_burned FLOAT, fuel_mmbtu_per_unit FLOAT, fuel_cost_per_unit_burned FLOAT, fuel_cost_per_unit_delivered FLOAT, fuel_cost_per_mmbtu FLOAT, PRIMARY KEY (id), FOREIGN KEY(plant_name_ferc1, utility_id_ferc1) REFERENCES plants_ferc1 (plant_name_ferc1, utility_id_ferc1), CONSTRAINT fuel_ferc1_fuel_type_code_pudl_enum CHECK (fuel_type_code_pudl IN ('coal', 'oil', 'gas', 'solar', 'wind', 'hydro', 'nuclear', 'waste', 'unknown')), CONSTRAINT fuel_ferc1_fuel_unit_enum CHECK (fuel_unit IN ('ton', 'mcf', 'bbl', 'gal', 'kgal', 'gramsU', 'kgU', 'klbs', 'btu', 'mmbtu', 'mwdth', 'mwhth', 'unknown')) );

Note that fuel_unit is a unit that pint can understand, and that fuel_qty_burned is a column of data that could be expressed in terms of actual units, not merely as a dimensionless number. Ditto the fuel_cost_per_unit_... columns. Is there a way to give a column a default metadata unit (such as tons or USD/ton) and then let that be overridden when the metadata in another column says barrels or USD/gramsU?

@catalyst-cooperative

107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1460/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
   

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 1.095ms · About: github-to-sqlite