Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify EPA CAMD EIA X-walk output to just read from DB. #2440

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

zaneselvans
Copy link
Member

PR Overview

A minor simplification of access for the epacamd_eia table, since all we do is read it straight from the DB.

PR Checklist

  • Merge the most recent version of the branch you are merging into (probably dev).
  • All CI checks are passing. Run tests locally to debug failures
  • Make sure you've included good docstrings.
  • For major data coverage & analysis changes, run data validation tests
  • Include unit tests for new functions and classes.
  • Defensive data quality/sanity checks in analyses & data processing functions.
  • Update the release notes and reference reference the PR and related issues.
  • Do your own explanatory review of the PR to help the reviewer understand what's going on and identify issues preemptively.

@zaneselvans zaneselvans added glue PUDL specific structures & metadata. Stuff that connects datasets together. eia860 Anything having to do with EIA Form 860 output Exporting data from PUDL into other platforms or interchange formats. epacems Integration and analysis of the EPA CEMS dataset. labels Mar 22, 2023
@zaneselvans zaneselvans added this to the 2023Q1 milestone Mar 22, 2023
Comment on lines -14 to -20
def epacamd_eia(pudl_engine: sa.engine.Engine) -> pd.DataFrame:
"""Pull the EPACAMD-EIA Crosswalk table."""
pt = pudl.output.pudltabl.get_table_meta(pudl_engine)
crosswalk_tbl = pt["epacamd_eia"]
crosswalk_select = sa.sql.select(crosswalk_tbl)
crosswalk_df = pd.read_sql(crosswalk_select, pudl_engine)
return crosswalk_df
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised the original function didn't apply any type conversions. I wonder if passing the table through apply_pudl_dtypes will break downstream analyses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we'll know shortly!

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage: 50.0% and no project coverage change.

Comparison is base (93d8ff3) 86.4% compared to head (d31f43f) 86.5%.

Additional details and impacted files
@@               Coverage Diff               @@
##           dagster-eia861   #2440    +/-   ##
===============================================
  Coverage            86.4%   86.5%            
===============================================
  Files                  81      81            
  Lines                9794    9443   -351     
===============================================
- Hits                 8468    8169   -299     
+ Misses               1326    1274    -52     
Impacted Files Coverage Δ
src/pudl/output/epacems.py 87.5% <ø> (+10.0%) ⬆️
src/pudl/output/pudltabl.py 97.7% <50.0%> (+0.7%) ⬆️

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zaneselvans zaneselvans self-assigned this Mar 23, 2023
@zaneselvans zaneselvans merged commit 4c5fc14 into dagster-eia861 Mar 23, 2023
@zaneselvans zaneselvans deleted the epacamd-eia-xwalk-pudltabl branch March 23, 2023 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eia860 Anything having to do with EIA Form 860 epacems Integration and analysis of the EPA CEMS dataset. glue PUDL specific structures & metadata. Stuff that connects datasets together. output Exporting data from PUDL into other platforms or interchange formats.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants