diff --git a/scripts/us_epa/airqualityindex/manifest.json b/scripts/us_epa/airqualityindex/manifest.json index dbf52bba55..b56f4e49a7 100644 --- a/scripts/us_epa/airqualityindex/manifest.json +++ b/scripts/us_epa/airqualityindex/manifest.json @@ -20,10 +20,11 @@ } ], "cron_schedule": "15 22 10 1,7 *", + "validation_config_file": "validation_config.json", "resource_limits": { "cpu": 32, "memory": 128, - "disk": 512 + "disk": 300 } } ] diff --git a/scripts/us_epa/airqualityindex/validation_config.json b/scripts/us_epa/airqualityindex/validation_config.json new file mode 100644 index 0000000000..b75f48229a --- /dev/null +++ b/scripts/us_epa/airqualityindex/validation_config.json @@ -0,0 +1,28 @@ +{ + "schema_version": "1.0", + "rules": [ + { + "rule_id": "check_deleted_records_percent", + "description": "Strictly enforce historical deletion average threshold of 0.1%", + "validator": "DELETED_RECORDS_PERCENT", + "params": { + "threshold": 0.1 + } + }, + { + "rule_id": "check_max_date_consistent", + "description": "Checks if the MaxDate is the same for all StatVars.", + "validator": "MAX_DATE_CONSISTENT", + "params": {} + }, + { + "rule_id": "check_max_date_freshness", + "description": "Verifies that the dataset's maximum observation date meets freshness requirements (within 1 year of current year)", + "validator": "SQL_VALIDATOR", + "params": { + "query": "SELECT MAX(CAST(LEFT(CAST(MaxDate AS VARCHAR), 4) AS INT)) AS max_year FROM stats", + "condition": "max_year >= (EXTRACT(YEAR FROM CURRENT_DATE) - 1)" + } + } + ] +}