<@U086EV6P58D> see the error message: 'test_null_c...
# ask-elementary-ai
w
@Noya Offer see the error message: 'test_null_count' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps".
k
A message from kapa.ai
The error message: > 'test_null_count' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". indicates that dbt cannot find a macro or test named
test_null_count
. This is a common issue when: 1. There is a typo in the test or macro name. 2. The required dbt package containing the macro/test is not installed or not properly referenced. 3. You have not run
dbt deps
after updating your
packages.yml
file. Recommended steps: - Check for typos: Ensure that the test or macro name is spelled correctly. For example, similar issues have occurred when users wrote
columns_anomalies
instead of the correct
column_anomalies
or
all_column_anomalies
instead of
all_columns_anomalies
[see example](https://slack.com/archives/C02CTC89LAX/p1700156589161519), [another example](https://slack.com/archives/C02CTC89LAX/p1669869610086149). - Verify package installation: Make sure the dbt package that provides the macro or test is included in your
packages.yml
and that you have run
dbt deps
to install it. If you recently added or updated a package, running
dbt deps
is required to fetch the latest macros and tests [see guidance](https://slack.com/archives/C02CTC89LAX/p1666270953446809). - Check the correct test name: If you are using Elementary, confirm that
test_null_count
is a valid test provided by the package. If not, refer to the documentation or use the correct test name. If after these steps the issue persists, double-check your
packages.yml
and ensure there are no version mismatches or missing dependencies. If you are still unable to resolve the error, please provide the relevant section of your
packages.yml
and the command you are running for further assistance.
n
@Wale Olaitan Are you referring to the
null_count
parameter of column anomaly detection? https://docs.elementary-data.com/data-tests/anomaly-detection-tests/column-anomalies
w
@Noya Offer, Yes, I have install up to date dbt util packages and elementary-data/elementary but null_count and similar metrics are give the following compilation error : 'test_null_count' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps".
n
Can you please share the test configuration?
w
@Noya Offer not sure indentation will be intact here: - identifier: contract__c name: bronze_salesforce_contract__c description: "Salesforce contracts detail table" config: tags: ["elementary", "data_ingestion", "core_data"] columns: - name: id description: "Contracts unique identifier." tests: - unique - not_null - name: Total_Contract_Value__c description: "FK from opportunity table - check for multiple opp on a contract" tests: - not_null - null_count tests: - elementary.schema_changes: config: severity: warn tags: ["elementary"] # - elementary.all_columns_anomalies: # config: # anomaly_detector: "auto" # sensitivity: 0.001 # severity: warn # tags: ["elementary", "column_monitoring", "data_quality"] - elementary.column_anomalies: column_name: Total_Contract_Value__c - zero_count - null_count - average config: severity: warn tags: ["elementary", "contract_value_tests"] - elementary.column_anomalies: column_name: Contract_End_Date__c - null_count - null_percent where_expression: "Contract_End_Date__c is null and Status__c = 'Expired' and Terminated__c is false and Rolling_Contract__c is true" description: "Rolling contracts with no end date" config: severity: warn tags: ["elementary", "Rolling_Contracs_no_enddate"]
👀 2