{"info": {"name": "RunningOperationCaughtError", "...
# ask-elementary-ai
n
{"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Runtime Error\n ClickHouse exception: 'elementary_test_results_id'", "level": "error", "invocationId": "e16f0a32-389e-44ba-954a-26c441f07ba0", "pid": 2016, "thread": "MainThread", "ts": "2025-08-15T165026.922796Z"}, "data": {"exc": "Runtime Error\n ClickHouse exception: 'elementary_test_results_id'"}}
k
A message from kapa.ai
The error message you provided indicates a ClickHouse exception related to the identifier 'elementary_test_results_id'. Based on the knowledge sources, there is no explicit documentation or discussion about this specific error or about official support for ClickHouse as a backend for Elementary Data. However, similar errors in other warehouses (such as missing columns or tables) are often caused by schema mismatches, missing migrations, or version incompatibilities between the Elementary dbt package and the CLI. For example, errors like "column elementary_test_results.invocation_id does not exist" or "Unable to insert rows to non-existent table" have been resolved by ensuring that the dbt package is up to date and that all required tables and columns exist by running:
Copy code
dbt run --select elementary --full-refresh
If you are using a non-standard warehouse like ClickHouse, it's possible that some macros or models expect certain columns (like 'elementary_test_results_id') to exist, but they are missing due to incomplete setup or lack of official support. Recommended steps: 1. Ensure you are using compatible versions of the Elementary dbt package and CLI. 2. Run
dbt run --select elementary --full-refresh
to recreate all Elementary tables and columns. 3. Check if ClickHouse is officially supported by Elementary. If not, you may encounter compatibility issues that are not documented in the knowledge sources. If the issue persists after these steps, the knowledge sources do not provide a direct solution for ClickHouse-specific errors. You may need to reach out to the Elementary team for further assistance or consider using a supported data warehouse backend. I'm sorry, but there's no information about ClickHouse-specific support or this exact error in the knowledge sources provided. If you need further help, contacting the Elementary team or community is recommended.
n
I have dbt elementart 0.19.2 and cli 0.19.4. It is ok?
@kapa.ai I have dbt elementart 0.19.2 and cli 0.19.4. It is ok?
k
A message from kapa.ai
Based on the knowledge sources, it is recommended to use matching minor versions for both the Elementary dbt package and the CLI (Python package). For example, if you are using CLI version 0.19.x, you should use the dbt package version 0.19.y. This ensures compatibility and prevents issues during operation. Using different minor versions (e.g., dbt package 0.19.2 and CLI 0.19.4) is generally considered compatible, as long as the minor version (0.19) matches, even if the patch version (the last digit) is different. However, if you use different minor versions (e.g., 0.18.x and 0.19.x), you may encounter compatibility issues and warnings from Elementary. Always ensure both are on the same minor version for best results [see this guidance](https://slack.com/archives/C02CTC89LAX/p1687993325259259) and [here](https://github.com/elementary-data/elementary/issues/1670). So, having dbt elementary 0.19.2 and CLI 0.19.4 is OK, as both are on the 0.19 minor version. If you encounter any issues, make sure both are updated to the latest 0.19.x release and run
dbt deps
and
dbt run --select elementary
to ensure all models and tables are up to date.
n
why table elementary.test_result_rows is empty? @kapa.ai
k
A message from kapa.ai
There are several common reasons why the
elementary.test_result_rows
table might be empty: 1. dbt Version 1.8+ Materialization Change If you are using dbt 1.8 or above, there was a change in how materializations work that can prevent
test_result_rows
from being populated. To fix this, add the following flag to your `dbt_project.yml`:
Copy code
yaml    flags:      require_explicit_package_overrides_for_builtin_materializations: false
This allows Elementary to override dbt's default materializations and is required for proper operation on dbt 1.8+ [see details](https://docs.elementary-data.com/oss/quickstart/quickstart-cli-package#important-allowing-elementary-to-override-dbts-default-materializations-relevant-from-dbt-1-8) https://slack.com/archives/C02CTC89LAX/p1734111312018389. 2. No Failing Test Rows The table only stores sample rows from failed tests. If your tests are all passing, or if you haven't configured tests to store sample rows, the table will remain empty. 3. Materialization or Configuration Issues If the Elementary models are not materialized as tables (for example, if they are materialized as views), data cannot be inserted. Make sure your
dbt_project.yml
does not override the materialization for Elementary models. The correct configuration should look like:
Copy code
yaml    models:      elementary:        +schema: 'elementary'        +materialized: table
[See troubleshooting guide](https://docs.elementary-data.com/oss/general/troubleshooting). 4. Not Running Tests After Deploying Elementary After running
dbt run --select elementary
, you must also run
dbt test
to populate the tables. If you haven't run tests after deploying the package, the table will be empty https://slack.com/archives/C02CTC89LAX/p1660748994945629. 5. Target/Schema Mismatch If you run
dbt run --select elementary
and
dbt test
on different targets or schemas, the results may not be written to the expected location. Always use the same target and schema for both commands https://slack.com/archives/C02CTC89LAX/p1684095583307509. 6. Custom Test or Macro Issues Some custom tests or project macros may interfere with the on-run-end hook that populates this table. Check your logs for any errors or warnings related to Elementary hooks https://slack.com/archives/C02CTC89LAX/p1718816885919229. If you have checked all of the above and the table is still empty, review your
dbt.log
and
edr.log
files for errors, and consider reaching out to the Elementary support team for further assistance.
n
@kapa.ai how generate some data in test_result_rows?
k
A message from kapa.ai
To generate data in the
elementary.test_result_rows
table, you need to run dbt tests that produce failing rows. This table is specifically designed to store a sample of the rows that caused a test to fail. Here’s how you can do it: 1. Ensure You Have Failing Tests The
test_result_rows
table only gets populated when there are failed test rows. If all your tests pass, the table will remain empty. You can create or modify a test so that it fails (for example, a
not_null
test on a column that contains nulls). 2. Run Your dbt Tests Execute your dbt tests as usual:
Copy code
dbt test
This will run all tests and, if there are failures, Elementary will sample the failed rows and insert them into
test_result_rows
(by default, up to 5 rows per test failure, configurable via the
test_sample_row_count
variable) [see documentation](https://docs.elementary-data.com/dbt/package-models#run-results). 3. Check Your Configuration - Make sure the Elementary dbt package is installed and up to date. - If you want to increase the number of sample rows stored, set the variable in your `dbt_project.yml`:
Copy code
yaml      vars:        test_sample_row_count: 10
This will store up to 10 failed rows per test [see example](https://slack.com/archives/C02CTC89LAX/p1704277382272089). 4. dbt 1.8+ Users If you are using dbt 1.8 or above, add the following to your
dbt_project.yml
to ensure Elementary can override materializations:
Copy code
yaml    flags:      require_explicit_package_overrides_for_builtin_materializations: false
[See more](https://slack.com/archives/C02CTC89LAX/p1734111312018389). 5. Run Elementary Models After running your tests, make sure to run the Elementary models to process and store the results:
Copy code
dbt run --select elementary
Summary: To generate data in
test_result_rows
, you need failing dbt tests, the Elementary package properly configured, and to run both your tests and the Elementary models. The table will then be populated with a sample of the failed rows for each test failure. If you follow these steps and still see no data, double-check your configuration and logs for errors, especially if you are using dbt 1.8+ or a non-standard data warehouse.