Skip to content

Commit

Permalink
fixed a few logging bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jevans-cdphe committed Feb 16, 2024
1 parent b3f7af4 commit 653f287
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions default_config/transform_ecmc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ production_columns_to_keep:
- oil_prod
- water_prod
completions_columns_to_keep:
- name
- operator_num
- facility_name
- facility_num
- well_name
Expand Down
6 changes: 3 additions & 3 deletions oip_ecmc_app/convert_access_to_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def main() -> None:
with parquet_metadata_path.open('w') as f:
json.dump(utils.to_json(parquet_metadata, logger=logger), f)

driver = get_access_driver(
config.Config.microsoft_access_driver, logger)
driver = get_access_driver(config.Config.microsoft_access_driver)
data = mdb_import(access_db_metadata, logger, driver=driver)
write_parquet(parquet_path, data, logger)

Expand All @@ -124,7 +123,8 @@ def read_odbc_table(
) -> pl.DataFrame:
logger.info(f'loading data from {table} in {connection[ODBCKey.dbq]}')
query = f'SELECT * FROM \"{table}\"'
return pl.read_database(query, connection=odbc_connection_str(connection))
return pl.read_database(
query, connection=odbc_connection_str(connection, logger))


def get_parquet_metadata(
Expand Down
1 change: 0 additions & 1 deletion oip_ecmc_app/scrape_from_ecmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def main() -> None:
utils.to_json(
get_db_metadata(access_db_path, zip_metadata, logger)),
f,
logger=logger,
)


Expand Down
4 changes: 1 addition & 3 deletions oip_ecmc_app/transform_ecmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class Config:
'water_prod',
]
completions_columns_to_keep: List[str] = [
'name',
'operator_num',
'facility_name',
'facility_num',
'well_name',
Expand Down Expand Up @@ -165,7 +163,7 @@ def write_output_data(
data['completions'][max(data['completions'])],
on='API_num',
how='outer',
).select(pl.exclude('^.*_right$'))
)
if remove_co2_wells:
df_out = df_out.filter(pl.col('Prod_days') != 0)
df_out.write_csv(output_path / f'{year}.csv')
Expand Down

0 comments on commit 653f287

Please sign in to comment.