From d45005b16cbb55af0dcb9cfa6e5cdf4883f43d82 Mon Sep 17 00:00:00 2001 From: Christina Gosnell Date: Fri, 20 Dec 2024 11:56:02 -0500 Subject: [PATCH] make the warning only warn once --- src/pudl/transform/ferc714.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pudl/transform/ferc714.py b/src/pudl/transform/ferc714.py index 067ea0025..8c2cc278e 100644 --- a/src/pudl/transform/ferc714.py +++ b/src/pudl/transform/ferc714.py @@ -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( @@ -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}) @@ -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]