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

update excepted rows for no-fips id-ed respondents but keep annualize… #3023

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
add minmax rows into validation test for chonky table
  • Loading branch information
cmgosnell committed Nov 7, 2023
commit f25e921aa88b1ba6b1bb4e4764f0e65bf3494491
27 changes: 24 additions & 3 deletions test/validate/service_territory_test.py
Original file line number Diff line number Diff line change
@@ -48,9 +48,30 @@ def test_minmax_rows(
)


def test_report_year_discrepency_in_demand_hourly_pa_ferc714(pudl_out_orig):
"""Test if the vast majority of the years in the two date columns line up."""
demand_hourly_pa_ferc714 = pudl_out_orig.demand_hourly_pa_ferc714()
@pytest.mark.parametrize(
"df_name,expected_rows",
[("demand_hourly_pa_ferc714", 15_608_154)],
)
def test_minmax_rows_and_year_in_demand_hourly_pa_ferc714(
pudl_out_orig: "pudl.output.pudltabl.PudlTabl",
live_dbs: bool,
expected_rows: int,
df_name: str,
):
"""Test if the majority of the years in the two date columns line up & min/max rows.

We are parameterizing this test even though it only has one input because the
test_minmax_rows is a common test across many tables and we wanted to preserve the
format.
"""
if not live_dbs:
pytest.skip("Data validation only works with a live PUDL DB.")
demand_hourly_pa_ferc714 = pudl_out_orig.__getattribute__(df_name)()
_ = demand_hourly_pa_ferc714.pipe(
pv.check_min_rows, expected_rows=expected_rows, margin=0.0, df_name=df_name
).pipe(pv.check_max_rows, expected_rows=expected_rows, margin=0.0, df_name=df_name)

logger.info("Checking the consistency of the year in the multiple date columns.")
mismatched_report_years = demand_hourly_pa_ferc714[
(
demand_hourly_pa_ferc714.utc_datetime.dt.year