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

only fix a reporting_frequency_code when the column exists #3013

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/pudl/extract/eia923.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ def process_raw(self, df, page, **partition):
df = remove_leading_zeros_from_numeric_strings(df=df, col_name=col)
df = self.add_data_maturity(df, page, **partition)
# Fill in blank reporting_frequency_code for monthly data
df.loc[
df["data_maturity"] == "incremental_ytd", "reporting_frequency_code"
] = "M"
if "reporting_frequency_code" in df.columns:
df.loc[
df["data_maturity"] == "incremental_ytd", "reporting_frequency_code"
] = "M"
# the 2021 early release data had some ding dang "."'s and nulls in the year column
if "report_year" in df.columns:
mask = (df.report_year == ".") | df.report_year.isnull()
Expand Down
4 changes: 2 additions & 2 deletions test/validate/mcoe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def test_no_null_rows_mcoe(pudl_out_mcoe, live_dbs, df_name, thresh):
("hr_by_unit", 387_694, 32_416),
("hr_by_gen", 599_496, 50_070),
("fuel_cost", 599_496, 50_070),
("capacity_factor", 5_178_892, 433_277),
("mcoe", 5_179_300, 433_311),
("capacity_factor", 5_178_828, 433_286),
("mcoe", 5_179_236, 433_320),
],
)
def test_minmax_rows_mcoe(pudl_out_mcoe, live_dbs, monthly_rows, annual_rows, df_name):
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ commands =
{[testenv:unit]commands}
{[testenv:integration]commands}
bash -c 'rm -f tox-nuke.log'
bash -c 'coverage run --append src/pudl/convert/ferc_to_sqlite.py --logfile tox-nuke.log --clobber src/pudl/package_data/settings/etl_full.yml'
bash -c 'coverage run --append src/pudl/cli/etl.py --logfile tox-nuke.log --clobber src/pudl/package_data/settings/etl_full.yml'
bash -c 'coverage run --append src/pudl/ferc_to_sqlite/cli.py --logfile tox-nuke.log --clobber src/pudl/package_data/settings/etl_full.yml'
bash -c 'coverage run --append src/pudl/cli/etl.py --logfile tox-nuke.log src/pudl/package_data/settings/etl_full.yml'
pytest {tty:--color=yes} --live-dbs {posargs} {[testenv]covargs} \
--etl-settings src/pudl/package_data/settings/etl_full.yml \
test/integration
Expand Down