Issue overview
Columns used to partition parquet tables through buildstockbatch's postprocessing partition_columns are left unformatted (i.e., without any prefixes). This makes the partitioned columns unqueriable for some functions, like agg.aggregate_annual because we only attempt to fetch them in a format inferred from db_schema.
For example, OEDI tables "resstock_2024_amy2018_release_2_metadata_state_vu" and "resstock_2024_amy2018_release_2_by_state_vu" are partitioned by state. The state column name in both tables is state instead of in.state. State is unfetchable for annual aggregation. HOWEVER, agg.aggregate_timeseries and other functions seem to take input column as is and does not appear to have this problem.
Current Behavior
Error received:
*** ValueError: Invalid column name in.state
Expected Behavior
Steps to Reproduce
- Run demo notebook: https://github.com/NREL/buildstock-query/blob/370f27ccf6ae35cbd8eea957fcb6332906e416de/example_usage/basic_usage_oedi.ipynb#L8
- Under Simple Annual Query, change group_by from ["geometry_building_type_recs"] to ["state"]
Possible Solution
Allow _get_column() of unformatted column
Details
Environment
Some additional details about your environment for this issue (if relevant):
- Platform (Operating system, version):
- Version of OpenStudio (if using an intermediate build, include SHA):
Context
Issue overview
Columns used to partition parquet tables through buildstockbatch's
postprocessingpartition_columnsare left unformatted (i.e., without any prefixes). This makes the partitioned columns unqueriable for some functions, likeagg.aggregate_annualbecause we only attempt to fetch them in a format inferred from db_schema.For example, OEDI tables
"resstock_2024_amy2018_release_2_metadata_state_vu"and"resstock_2024_amy2018_release_2_by_state_vu"are partitioned by state. The state column name in both tables isstateinstead ofin.state. State is unfetchable for annual aggregation. HOWEVER, agg.aggregate_timeseries and other functions seem to take input column as is and does not appear to have this problem.Current Behavior
Error received:
Expected Behavior
Steps to Reproduce
Possible Solution
Allow _get_column() of unformatted column
Details
Environment
Some additional details about your environment for this issue (if relevant):
Context