<@U088WCP3B4P> I want tu run edr report --project...
# ask-elementary-ai
m
@kapa.ai I want tu run edr report --project-dir . --profiles-dir . --dbt-quoting all --days-back 3 with Fusion But receive this error
Copy code
2025-10-27 14:58:00 — ERROR — Could not generate the report - Error: 1 validation error for TestResultDBRowSchema
severity
  none is not an allowed value (type=type_error.none.not_allowed)
Please reach out to our community for help with this issue.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/api/report/report.py", line 84, in get_report_data
    tests_api = TestsAPI(
                ^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/api/tests/tests.py", line 52, in __init__
    self.test_results_db_rows = self._get_test_results_db_rows(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/api/tests/tests.py", line 64, in _get_test_results_db_rows
    return self.tests_fetcher.get_all_test_results_db_rows(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/fetchers/tests/tests.py", line 38, in get_all_test_results_db_rows
    TestResultDBRowSchema(**test_result) for test_result in test_results
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pydantic/v1/main.py", line 347, in __init__
    raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for TestResultDBRowSchema
severity
  none is not an allowed value (type=type_error.none.not_allowed)
ERROR:elementary.monitor.data_monitoring.report.data_monitoring_report:Could not generate the report - Error: 1 validation error for TestResultDBRowSchema
severity
  none is not an allowed value (type=type_error.none.not_allowed)
Please reach out to our community for help with this issue.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/api/report/report.py", line 84, in get_report_data
    tests_api = TestsAPI(
                ^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/api/tests/tests.py", line 52, in __init__
    self.test_results_db_rows = self._get_test_results_db_rows(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/api/tests/tests.py", line 64, in _get_test_results_db_rows
    return self.tests_fetcher.get_all_test_results_db_rows(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/elementary/monitor/fetchers/tests/tests.py", line 38, in get_all_test_results_db_rows
    TestResultDBRowSchema(**test_result) for test_result in test_results
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pydantic/v1/main.py", line 347, in __init__
    raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for TestResultDBRowSchema
severity
  none is not an allowed value (type=type_error.none.not_allowed)
k
A message from kapa.ai
The error you're seeing:
Copy code
1 validation error for TestResultDBRowSchema severity   none is not an allowed value (type=type_error.none.not_allowed)
indicates that there is at least one row in your
elementary_test_results
table where the
severity
field is
NULL
(i.e., has no value). The Elementary CLI expects this field to always have a value, and if it encounters a
NULL
, it raises a validation error and fails to generate the report. This type of error has been seen before with other fields in Elementary, such as
compiled_sql
,
test_results_query
, and others. The recommended solution in those cases is to update the problematic column to have a default value (such as an empty string or a valid enum value) instead of
NULL
, or to delete the problematic rows if they are not needed. How to fix: 1. Check for NULLs in the severity column: Run a query like the following on your
elementary_test_results
table:
Copy code
sql    SELECT * FROM <your_database>.<your_elementary_schema>.elementary_test_results    WHERE severity IS NULL;
2. Update or delete the problematic rows: - If you want to keep the rows, update the
severity
to a valid value (e.g.,
'warn'
,
'error'
, etc.):
Copy code
sql      UPDATE <your_database>.<your_elementary_schema>.elementary_test_results      SET severity = 'warn'      WHERE severity IS NULL;
- If the rows are not needed, you can delete them:
Copy code
sql      DELETE FROM <your_database>.<your_elementary_schema>.elementary_test_results      WHERE severity IS NULL;
This approach is consistent with previous guidance for similar issues with other fields in Elementary, where setting a default value or removing problematic rows resolved the validation error and allowed the report to be generated successfully [see example for compiled_sql](https://slack.com/archives/C02CTC89LAX/p1664550366911369), [see example for test_results_query](https://slack.com/archives/C02CTC89LAX/p1657883114555219). Note: If you continue to encounter this issue after fixing the data, make sure you are using the latest version of the Elementary CLI and dbt package, as some of these validation issues have been addressed in recent releases. If you need more help, please provide the output of the query above or share your
edr.log
for further troubleshooting.
m
@kapa.ai I updated records but when i run dbtF build again i receive again NULL severity column my DBT_Project.yml # Name your project! Project names should contain only lowercase characters # and underscores. A good package name should reflect your organization's # name or the intended use of these models name: 'V_DBT' version: '1.0.0' config-version: 2 # This setting configures which "profile" dbt uses for this project. profile: 'V-DBT' # These configurations specify where dbt should look for different types of files. # The
model-paths
config, for example, states that models in this project can be # found in the "models/" directory. You probably won't need to change these! model-paths: ["models"] analysis-paths: ["analyses"] test-paths: ["tests"] seed-paths: ["seeds"] macro-paths: ["macros"] snapshot-paths: ["snapshots"] clean-targets: # directories to be removed by
dbt clean
- "target" - "dbt_packages" # Configuring models # Full documentation: https://docs.getdbt.com/docs/configuring-models models: V_DBT: +materialized: table FL0: +schema: L2 product_parameters: +schema: FL0_PRODUCT_PARAMETERS delivery_and_payment: +schema: FL0_DELIVERY_AND_PAYMENT product_variant: +schema: FL0_PRODUCT_VARIANT shops: +schema: FL0_SHOPS tags: +schema: FL0_TAGS customer: +schema: FL0_CUSTOMER k2_fresh_food: +schema: FL0_K2_FRESH_FOOD septim: +schema: FL0_SEPTIM FL1: +schema: FL1 prep: +schema: FL1_PREP VALIDATION: +schema: VALIDATION elementary: +schema: ELEMENTARY seeds: +schema: SEEDS V_DBT: +column_types: id: varchar(255) # quoting everywhere: quoting: database: true schema: true identifier: true
k
A message from kapa.ai
Based on the knowledge sources, the issue of the
severity
column being set to
NULL
in the
elementary_test_results
table after running
dbt build
is not directly addressed with a root-cause fix in the documentation or community discussions. However, there are some important points and related guidance: - The
severity
field is a dbt-native configuration, and it should be set either at the test level or via the
dbt_project.yml
file. If it is not set, dbt defaults to
error
for test severity, but if something in your configuration or test definitions is omitting it, it may result in
NULL
values in the artifacts Elementary processes. - Several users have reported similar issues with other fields being
NULL
in Elementary tables, and the recommended workaround is to update or delete problematic records. However, if the problem recurs after every run, it suggests that the root cause is in how the tests are defined or how dbt/Elementary is configured or invoked [see related discussion](https://slack.com/archives/C02CTC89LAX/p1667235242489099). Key points from the sources: - You can set a default severity for all tests in a folder or at the project level in
dbt_project.yml
using the
tests:
section. For example:
Copy code
yaml   tests:     elementary:       +severity: warn
This should apply to all Elementary tests, but there are reports that it does not always work as expected for all users or all test types [see here](https://slack.com/archives/C02CTC89LAX/p1711559815403719), [and here](https://slack.com/archives/C02CTC89LAX/p1717184844467369). - If you want to set severity only for Elementary tests and not for all dbt tests, there is currently no supported way to do this at the module/package level without affecting dbt-native tests. The only workaround is to use tags to separate test runs or to set severity explicitly on each test [see here](https://slack.com/archives/C02CTC89LAX/p1736747235746699). - If you are consistently getting
NULL
for severity, it may be due to missing or misconfigured severity in your test definitions, or a bug in the version of Elementary or dbt you are using. Upgrading to the latest versions of both is recommended, as some issues have been fixed in recent releases [see here](https://slack.com/archives/C02CTC89LAX/p1736544876896189). What you can try: 1. Explicitly set severity for all Elementary tests in your
dbt_project.yml
under the
tests:
section:
Copy code
yaml    tests:      elementary:        +severity: warn
If this does not work, try setting it at a more granular level (per folder or per test). 2. Upgrade to the latest versions of both the Elementary dbt package and the Elementary CLI, as some issues with test result fields have been fixed in newer releases. 3. Check your test definitions to ensure that all tests have a severity set, especially if you are using custom or singular tests. 4. If the issue persists, it may be a bug or incompatibility. In that case, collect your
dbt.log
and reach out to the Elementary community or support for further troubleshooting, as suggested in similar cases [see here](https://slack.com/archives/C02CTC89LAX/p1667235242489099). Summary: There is no definitive fix in the knowledge sources for recurring
NULL
severity values after each run. The best practices are to set severity explicitly in your configuration, ensure you are on the latest versions, and reach out to support with logs if the problem continues. If you need more targeted help, please share your test definitions and the versions of dbt and Elementary you are using, as this may help identify the root cause.