Vamsi
07/30/2025, 6:43 AMkapa.ai
07/30/2025, 6:43 AMkapa.ai
07/30/2025, 6:43 AMDatabase Error 000904 (42000): SQL compilation error: error line XX at position XX invalid identifier 'UNIQUE_KEY' or Unrecognized name: unique_key; Did you mean unique_id? or similar for incremental_strategy. How to resolve: 1. Align the versions: Make sure that both your dbt package (in packages.yml) and your Python CLI (elementary-data) are on the same minor version. For example, if you are using elementary-data==0.16.2, your dbt package should also be version 0.16.2. Mismatched versions are a common cause of this error, as new columns are sometimes added in minor releases and both components must be upgraded together to avoid schema mismatches. 2. Rebuild the Elementary models: After upgrading both the dbt package and the CLI, you must run: dbt run --select elementary This will rebuild the Elementary models and update the schema (including adding any new columns like unique_key and incremental_strategy) in your data warehouse. Simply running dbt run without --select elementary may not be sufficient, as it might not rebuild all the necessary Elementary tables and views. 3. Retry the report generation: Once the above steps are complete, try running edr report again. This issue and its resolution have been discussed in several community threads, where users resolved it by aligning versions and running dbt run --select elementary after upgrading. Here are some relevant references: - [Slack thread: unique_key and incremental_strategy errors after upgrade](https://slack.com/archives/C02CTC89LAX/p1740038661814829) - [Slack thread: unique_key column does not exist in dbt_snapshots](https://slack.com/archives/C02CTC89LAX/p1739810287607029) - [Slack thread: Upgrading both CLI and dbt package resolves the issue](https://slack.com/archives/C02CTC89LAX/p1739981606338559) Summary: The unique_key and incremental_strategy columns are new additions to the elementary.dbt_snapshots table, required by recent versions of Elementary. If you see errors about these columns being invalid or missing, upgrade both your dbt package and CLI to the same minor version and run dbt run --select elementary to update your schema. This should resolve the compilation and identifier errors when generating EDR reports.Vamsi
07/30/2025, 8:46 AMkapa.ai
07/30/2025, 8:46 AMkapa.ai
07/30/2025, 8:46 AMkapa.ai
07/30/2025, 8:47 AMpackages.yml file in your dbt project. It contains dbt models, macros, and resources that run inside your dbt project. - Elementary CLI (elementary-data): This is a Python package you install via pip (elementary-data). It provides the edr command-line tool for generating reports, monitoring, and interacting with the Elementary platform outside of dbt. ### How to Check Existing Versions - dbt package version: Check your packages.yml file in your dbt project directory. The version is specified like this: yaml packages: - package: elementary-data/elementary version: <version> - CLI version: Run the following command in your terminal: pip show elementary-data or edr --version ### How to Upgrade #### Upgrade the dbt package 1. Edit your packages.yml file and set the version to the latest: yaml packages: - package: elementary-data/elementary version: <latest version> 2. Run: dbt deps 3. If you are changing the minor version (e.g., 0.4.x → 0.5.x), also run: dbt run --select elementary This ensures all Elementary models and tables are updated in your data warehouse. #### Upgrade the CLI Run: pip install elementary-data --upgrade For more details, see the official documentation: [How to upgrade Elementary?](https://docs.elementary-data.com/oss/release-notes/upgrading-elementary)kapa.ai
07/30/2025, 8:47 AMpackages.yml in your dbt project. It contains dbt models, macros, and resources that run inside your dbt project. - Elementary CLI: This is a Python package (elementary-data) you install with pip. It provides the edr command-line tool for generating reports, monitoring, and interacting with your data warehouse using the models from the dbt package. ### How to Check Existing Versions - dbt package version: Check your packages.yml file in your dbt project. The version is specified under the elementary package entry. - CLI version: Run the following command in your terminal: edr --version Or, if you want to check the installed Python package version: pip show elementary-data ### How to Upgrade #### Upgrade the dbt package 1. Edit your packages.yml file to set the latest version: yaml packages: - package: elementary-data/elementary version: <latest version> 2. Run: dbt deps 3. If upgrading to a new minor version (e.g., 0.15.x → 0.16.x), also run: dbt run --select elementary This ensures all new models and schema changes are applied. #### Upgrade the CLI Run: pip install elementary-data --upgrade For more details, see the official [Elementary upgrade guide](https://docs.elementary-data.com/oss/release-notes/upgrading-elementary#upgrade-elementary-dbt-package) and [CLI install instructions](https://docs.elementary-data.com/oss/cli-install#how-to-create-profiles-yml). --- Summary: - The dbt package runs inside your dbt project; the CLI is a separate Python tool. - Check versions in packages.yml (dbt package) and with edr --version or pip show elementary-data (CLI). - Upgrade the dbt package by editing packages.yml and running dbt deps (and dbt run --select elementary for minor upgrades). - Upgrade the CLI with pip install elementary-data --upgrade [How to upgrade Elementary?](https://docs.elementary-data.com/oss/release-notes/upgrading-elementary)Vamsi
07/31/2025, 1:26 PMkapa.ai
07/31/2025, 1:26 PMkapa.ai
07/31/2025, 1:26 PM--env flag when running edr report. This label is just a visual indicator and does not automatically reflect your dbt target or database. To change it, run your report command with the desired environment, for example: edr report --env sandbox Note: - In older versions, only “dev” and “prod” were supported as values for --env. In more recent versions (0.16+), you can use custom environment names like “sandbox” [see here](https://slack.com/archives/C02CTC89LAX/p1726176545966149). - The --env flag only changes the label in the report UI; it does not affect which database or schema is queried. That is controlled by your dbt target/profile settings [see here](https://slack.com/archives/C02CTC89LAX/p1678730609472549). Summary: - Data Health, Catalog, Incidents, and Environments are only available in Elementary Cloud. - To change the environment label in the report, use the --env flag with your desired environment name (supported in version 0.16+). - The label does not automatically reflect your dbt target; you must set it manually. If you need more control over the environment label, ensure you are using Elementary version 0.16 or higher.Vamsi
07/31/2025, 2:12 PMkapa.ai
07/31/2025, 2:12 PMkapa.ai
07/31/2025, 2:12 PMsources.yml, landing.yml, or stage.yml under the relevant folders for each layer (e.g., landing, staging). For sources, you can define schema changes tests directly under each table in your source configuration. Here’s an example: yaml version: 2 sources: - name: my_source schema: landing tables: - name: my_table tests: - elementary.schema_changes: tags: [elementary] You can also use the elementary.schema_changes_from_baseline test if you want to check against a baseline schema (requires specifying columns and data types): yaml version: 2 sources: - name: my_source schema: landing tables: - name: my_table columns: - name: column1 data_type: string - name: column2 data_type: integer tests: - elementary.schema_changes_from_baseline [See example and details here](https://docs.elementary-data.com/data-tests/schema-tests/schema-changes-from-baseline) Key points: - Define the tests under the relevant table in the YAML file for that layer (e.g., landing.yml for landing tables, stage.yml for staging tables). - You cannot define a schema changes test at the source name level to apply to all tables automatically; you must specify it for each table individually [as confirmed here](https://slack.com/archives/C02CTC89LAX/p1702891428476719). - For models (not sources), you would define the test under the model in the relevant YAML file. Summary: Configure schema changes tests under each table in your source YAML files (like landing.yml, stage.yml, etc.) for the appropriate layer. There is no way to apply the test to all tables in a source at once; it must be specified per table.Vamsi
07/31/2025, 6:03 PMkapa.ai
07/31/2025, 6:03 PMkapa.ai
07/31/2025, 6:03 PMelementary.schema_changes or elementary.schema_changes_from_baseline) require running dbt run to execute the Elementary models that monitor schema changes. Running only dbt test is not enough for these tests to function properly, because the monitoring logic is implemented in dbt models, not just in tests. This is confirmed by Elementary support: > "However, monitoring for schema changes (elementary.schema_changes test) does require executing the models with dbt run." [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1653308392841579) So, to ensure schema changes are detected, you should run: dbt run --select elementary in addition to your usual dbt test commands.Vamsi
08/01/2025, 1:18 PMkapa.ai
08/01/2025, 1:18 PMkapa.ai
08/01/2025, 1:18 PMdbt could not find a macro with the name "schema_changes" in any package usually means that the Elementary dbt package is either not installed, not up to date, or not properly referenced in your project. Here’s what you should check and do: 1. Check your packages.yml Make sure you have the Elementary dbt package listed in your packages.yml file, for example: yaml packages: - package: elementary-data/elementary version: <your_version> After editing, run: dbt deps to install or update the package. 2. Check the version alignment If your CLI (elementary-data) and dbt package versions are not aligned, you may encounter missing macros or schema issues. Make sure both are on the same minor version and up to date. You can check the CLI version with: edr --version and the dbt package version in packages.yml [see upgrade instructions](https://docs.elementary-data.com/oss/release-notes/upgrading-elementary). 3. Run the correct commands The elementary.schema_changes is a test, not a macro you run with dbt run-operation. You should define it in your YAML files under the relevant models or sources, then run: dbt run --select elementary dbt test Running dbt run-operation elementary.schema_changes will not work because there is no such macro; the test is executed as part of dbt test and the monitoring logic as part of dbt run [see here](https://docs.elementary-data.com/data-tests/schema-tests/schema-changes). 4. Proxy issues If you are behind a corporate proxy, ensure that your proxy settings are not blocking access to download the dbt package or Python dependencies. If dbt deps fails or times out, check your proxy configuration. 5. Why tests may not show in the report If the schema changes tests are not reflected in the EDR report, it could be due to: - The tests not being executed (see above for correct commands). - The Elementary models not being run (dbt run --select elementary is required). - Version mismatch between CLI and dbt package. - Data not being written to the Elementary tables due to materialization or schema issues. Summary: - Do not run dbt run-operation elementary.schema_changes (it’s not a macro). - Define the test in your YAML, run dbt deps, then run dbt run --select elementary and dbt test. - Ensure both the dbt package and CLI are installed and on the same version. - Check your proxy is not blocking package downloads. If you follow these steps and still have issues, check your dbt.log and edr.log files for more details, as suggested in the troubleshooting guide [see troubleshooting steps](https://docs.elementary-data.com/oss/general/troubleshooting).Vamsi
08/01/2025, 2:22 PMkapa.ai
08/01/2025, 2:22 PMkapa.ai
08/01/2025, 2:22 PMschema_changes but the results are not appearing in the EDR report, and dbt ls --select test_type:generic package:element shows the tests in the terminal, here are some likely causes and troubleshooting steps based on the knowledge sources: 1. Elementary Models and Test Results Table The EDR report relies on data written to the elementary_test_results table. If the schema changes tests are running (as shown by dbt ls), but not appearing in the report, it could be that the test results are not being written to the correct table or schema. Double-check that your elementary profile in profiles.yml points to the same database and schema where the Elementary models and tables (including elementary_test_results) are created. This is a common cause for missing test results in the report [see this discussion](https://slack.com/archives/C02CTC89LAX/p1659002103951729). 2. Profile and Target Alignment Ensure that you are running dbt run --select elementary and dbt test on the same target/profile as the one used by the EDR CLI. If you run tests on one target and generate the report from another, the report may not find the test results [see here](https://slack.com/archives/C02CTC89LAX/p1683764076675589). 3. Version Compatibility If you recently upgraded Elementary, make sure both the dbt package and the CLI are on the same version, and that you have re-run dbt run --select elementary to update the models and tables as needed. Version mismatches can cause missing or misaligned data in the report. 4. Test Execution vs. Logging Even if the tests are listed and executed, if the underlying tables (like elementary_test_results) are empty or not being populated, the report will not show results. You can check directly in Snowflake if the elementary_test_results table contains recent records for your schema changes tests. 5. Debugging Steps - Check the elementary_test_results table for data. - Ensure the elementary profile in profiles.yml matches the schema where the tables are created. - Run edr monitor debug to validate your configuration. - Review the edr.log and dbt.log files for errors or warnings during test execution and report generation. If after these checks the issue persists, it may be helpful to share your log files with Elementary support for further troubleshooting, as suggested in several support threads. Summary: - The most common cause is a misalignment between the dbt target/profile used for running tests and the one used by the EDR CLI, or the results not being written to the expected schema/table [see here](https://slack.com/archives/C02CTC89LAX/p1659002103951729) and [here](https://slack.com/archives/C02CTC89LAX/p1683764076675589). - Double-check your configuration and ensure all steps are run on the same environment and profile. - Check the elementary_test_results table for data and review logs for errors. If you need more specific help, please provide the relevant configuration and log details.Vamsi
08/01/2025, 3:07 PMkapa.ai
08/01/2025, 3:07 PMkapa.ai
08/01/2025, 3:08 PMtest_1334566_elementary_schema_changes__stg_transaction) but not populating the elementary_test_results table—typically indicates that the test results are not being collected and loaded into the main Elementary results table. This can happen due to a few common misconfigurations: 1. Elementary Models Not Run: The schema changes tests require the Elementary models to be run, not just the tests themselves. You must execute: dbt run --select elementary This step is necessary for the logic that collects and loads test results (including schema changes) into the elementary_test_results table. Running only dbt test is not sufficient for schema changes tests to be reflected in the report or the results table [see here](https://slack.com/archives/C02CTC89LAX/p1653308392841579). 2. On-Run-End Hooks Not Triggered: Elementary uses on-run-end hooks to upload test results to the elementary_test_results table. If these hooks are disabled or not running, the results will not be loaded. Check that you do not have any of the following variables set in your dbt command or `dbt_project.yml`: disable_run_results disable_tests_results disable_dbt_invocation_autoupload disable_dbt_artifacts_autoupload If any of these are set, the upload of test results may be disabled [see here](https://slack.com/archives/C02CTC89LAX/p1703824109693079). 3. Target/Profile Mismatch: Ensure that you are running both dbt run --select elementary and dbt test on the same target/profile as the one used by the EDR CLI. If the targets differ, the results may be written to a different schema or database, and the report will not find them [see here](https://slack.com/archives/C02CTC89LAX/p1684095583307509). 4. Version Compatibility: If you have recently upgraded Elementary, make sure both the dbt package and the CLI are on the same version, and re-run dbt run --select elementary to update the models and tables as needed. What to do: - Run: dbt run --select elementary dbt test on the same target/profile. - Check that no disabling variables are set. - Ensure your elementary profile in profiles.yml points to the correct schema. - After running these commands, check if the elementary_test_results table is now populated with your schema changes test results. If you follow these steps and still do not see results, review your dbt.log and edr.log files for errors, as suggested in the troubleshooting guides. Summary: You cannot manually "move" the results from the transient test tables to `elementary_test_results`; the Elementary models and hooks must do this automatically. Ensure you are running the correct commands and your configuration is aligned as described above [see here](https://slack.com/archives/C02CTC89LAX/p1653308392841579) and [here](https://slack.com/archives/C02CTC89LAX/p1703824109693079).Vamsi
08/02/2025, 12:37 PMkapa.ai
08/02/2025, 12:37 PMkapa.ai
08/02/2025, 12:37 PMedr report command, it includes data from the last 7 days. If you want to adjust this window, you can use the --days-back (or -d) parameter to specify a different number of days, for example: edr report --days-back 30 This functionality is available in the open-source (desktop/standalone) version of Elementary, not just in Elementary Cloud. The "Last 7 days" filter is the default, and you can extend it as needed using the CLI parameter [as confirmed here](https://slack.com/archives/C02CTC89LAX/p1686465000985369) and [here](https://slack.com/archives/C02CTC89LAX/p1708506510889439).Vamsi
08/02/2025, 12:40 PMkapa.ai
08/02/2025, 12:40 PMkapa.ai
08/02/2025, 12:40 PM--days-back parameter. For example, to include the last 30 days: edr report --days-back 30 This will update the report to show data for the specified period, and the label in the top right will reflect your chosen window (e.g., "Last 30 Days"). The UI does not allow you to interactively enable or change this filter after the report is generated [as confirmed here](https://slack.com/archives/C02CTC89LAX/p1708506510889439) and [here](https://slack.com/archives/C02CTC89LAX/p1686465000985369). Summary: - The "Last 7 days" button is not interactive; it is just a label. - To change the time window, regenerate the report with the desired --days-back value. - There is currently no way to enable or interactively change this in the standalone report UI.Vamsi
08/02/2025, 12:43 PMkapa.ai
08/02/2025, 12:44 PMkapa.ai
08/02/2025, 12:44 PMschema_changes_from_baseline test in Elementary works by comparing the current schema of your table (columns and data types) against a baseline that you define in your dbt YAML configuration. If there are any differences—such as added, removed, or changed columns—the test can fail or alert you, depending on your configuration. ### How it works - You define the expected columns and their data types for a table or source in your YAML file. - The test checks the actual schema in your data warehouse against this baseline. - If there are differences (e.g., a column is added, removed, or its type changes), the test will fail or alert, depending on parameters like fail_on_added and enforce_types. ### Where and how to configure 1. Define the baseline in your YAML file You must specify the columns and their data types under the relevant table in your source or model YAML file. For example: yaml version: 2 sources: - name: my_source schema: my_schema tables: - name: my_table columns: - name: id data_type: integer - name: name data_type: varchar tests: - elementary.schema_changes_from_baseline: fail_on_added: true enforce_types: true The test will only work if the columns and data types are defined in the YAML configuration [see documentation](https://docs.elementary-data.com/data-tests/schema-tests/schema-changes-from-baseline). 2. (Optional) Auto-generate the baseline You can use the generate_schema_baseline_test macro to generate the baseline configuration based on your current table schema. Run: dbt run-operation elementary.generate_schema_baseline_test --args '{"name": "my_table", "fail_on_added": true, "enforce_types": true}' This will output the YAML configuration, which you then copy and paste into your YAML file. The macro does not update your YAML automatically; you must do this step manually [see clarification](https://github.com/elementary-data/elementary/issues/1455). 3. Run dbt commands After updating your YAML, run: dbt run --select elementary dbt test This ensures the Elementary models are updated and the tests are executed. ### Key points to ensure it works as expected - The baseline (columns and types) must be present in your YAML. - The test parameters (like fail_on_added and enforce_types) can be set in the YAML under the test. - The test does not update automatically if your schema changes; you must update the baseline in YAML if you want to accept new schema changes as the new baseline. - The test is supported for sources and models, but not for all data warehouses (e.g., not supported in Athena or Trino; Databricks support requires Unity Catalog) [see docs](https://docs.elementary-data.com/data-tests/schema-tests/schema-changes-from-baseline). If you follow these steps, schema_changes_from_baseline will work as expected and alert you to any schema drift from your defined baseline.