Skip to content

Commit

Permalink
make the warning only warn once
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgosnell committed Dec 20, 2024
1 parent e03810e commit d45005b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pudl/transform/ferc714.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ class Ferc714CheckSpec:
]


def make_check(spec: Ferc714CheckSpec) -> AssetChecksDefinition:
def make_row_num_check(spec: Ferc714CheckSpec) -> AssetChecksDefinition:
"""Turn the Ferc714CheckSpec into an actual Dagster asset check."""

@asset_check(
Expand All @@ -1290,7 +1290,7 @@ def _row_num_check(context, df):
errors.append(
f"Expected {expected_rows} for report year {year}, found {num_rows}"
)
logger.warning(errors)
logger.warning(errors)

if errors:
return AssetCheckResult(passed=False, metadata={"errors": errors})
Expand All @@ -1300,4 +1300,4 @@ def _row_num_check(context, df):
return _row_num_check


_checks = [make_check(spec) for spec in check_specs]
_checks = [make_row_num_check(spec) for spec in check_specs]

0 comments on commit d45005b

Please sign in to comment.