Мария Журавская
10/07/2025, 11:22 AMkapa.ai
10/07/2025, 11:22 AMkapa.ai
10/07/2025, 11:23 AMinternal_id) from the elementary.all_columns_anomalies test by using the exclude_prefix or exclude_regexp parameters. For a single column, the simplest way is to use exclude_prefix if your column name has a unique prefix, or exclude_regexp for an exact or partial match. For example, to exclude only the internal_id column, you can use: yaml models: - name: your_model_name tests: - elementary.all_columns_anomalies: exclude_regexp: "^internal_id$" This configuration will ensure that only the internal_id column is excluded from the analysis, while all other columns are still monitored. The exclude_regexp parameter matches the column name exactly in this case. Alternatively, if you want to exclude columns by prefix (e.g., all columns starting with internal_), you could use: yaml - elementary.all_columns_anomalies: exclude_prefix: "internal_" But for a single column, the regex approach is more precise. Note that exclude_prefix and exclude_regexp are only available for the all_columns_anomalies test, not for volume_anomalies or other tests [exclude_regexp documentation](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/exclude_regexp) [exclude_prefix documentation](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/exclude_prefix). If you want to set the seasonality parameter (e.g., from day to week), you can add it as follows: yaml - elementary.all_columns_anomalies: exclude_regexp: "^internal_id$" seasonality: day_of_week Let me know if you need an example for another test or further clarification!Мария Журавская
10/07/2025, 11:39 AMkapa.ai
10/07/2025, 11:39 AMkapa.ai
10/07/2025, 11:40 AMinternal_id column using exclude_regexp: "^internal_id$" in the elementary.all_columns_anomalies test is correct and should work for excluding a single column by exact name match [exclude_regexp documentation](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/exclude_regexp). However, there are a few important caveats and known issues: 1. YAML Indentation and Syntax: Ensure your YAML indentation is correct. The exclude_regexp parameter should be at the same level as other test parameters. 2. Test Name Still References Excluded Column: Even when a column is excluded, the generated dbt test name may still include the column name due to how dbt constructs test names. This does not necessarily mean the column is being tested, but it can be confusing [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1650985870725969). 3. dbt Package Version: The ability to exclude columns using exclude_regexp was added in version 0.3.14. If you are using an older version, this feature will not work. Please ensure you are using at least version 0.3.14 [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1650985870725969). 4. Known Limitation – Only One Prefix/Regexp: Only one exclude_prefix or exclude_regexp can be used at a time. If you need to exclude multiple columns, you must use a regular expression that matches all of them, e.g., exclude_regexp: "^(internal_id|other_column)$" [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1650985870725969). 5. Test Still Fails on Excluded Column: If the test is still failing on internal_id, it could be due to: - A typo in the column name. - The column is not being matched by the regex (double-check the exact column name in your database). - The dbt package version is too old. - There is a bug or edge case in the implementation (as reported by other users) [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1697205851749239). What you can try: - Double-check the spelling and case of internal_id in your model. - Make sure you are using dbt-elementary version 0.3.14 or newer. - Try a broader regex, e.g., exclude_regexp: "internal_id" (without the anchors) to see if it matches. - If you are still seeing the error, it may be a bug. Other users have reported similar issues, and the workaround is to use exclude_regexp with a pattern that matches the column, or to define the test at the column level and exclude the problematic column [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1697205851749239). If none of these resolve the issue, it is likely a bug, and you may want to open a ticket on the Elementary GitHub repository as other users have done. Let me know if you need help with a specific regex pattern or further troubleshooting!Мария Журавская
10/07/2025, 11:45 AMkapa.ai
10/07/2025, 11:45 AMkapa.ai
10/07/2025, 11:45 AMyaml models: - name: test_upload_on_day description: Middle layer model config: elementary: timestamp_column: report_day tests: - elementary.volume_anomalies: tags: ["elementary"] - elementary.all_columns_anomalies: tags: ["elementary"] exclude_regexp: "^internal_id$" seasonality: day_of_week Key points: - The parameters (tags, exclude_regexp, seasonality) should be indented two spaces under the test name. - Your use of exclude_regexp: "^internal_id$" is correct for excluding a single column by exact name [exclude_regexp documentation](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/exclude_regexp). - The seasonality parameter is also correctly placed. Version compatibility: You mentioned you are using Elementary version 0.19.5. The knowledge sources confirm that exclude_regexp is supported in recent versions, but the feature was introduced in version 0.3.14 of the dbt package. If you are referring to the dbt package version, ensure it is at least 0.3.14 for this feature to work as expected [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1650985870725969). If you still encounter issues after correcting the indentation and confirming the version, it may be a bug or an edge case as reported by other users. Let me know if you need further help!Мария Журавская
10/07/2025, 11:49 AMkapa.ai
10/07/2025, 11:49 AMkapa.ai
10/07/2025, 11:49 AMinternal_id) from anomaly detection, and the exclude_regexp or exclude_prefix options are not working as expected or are too broad, you can manually split the test by applying elementary.column_anomalies only to the columns you want to monitor. This approach gives you full control over which columns are tested. Here’s how you can do it: yaml models: - name: test_upload_on_day config: elementary: timestamp_column: report_day columns: - name: column1 tests: - elementary.column_anomalies: # your desired monitors here - name: column2 tests: - elementary.column_anomalies: # your desired monitors here # Do NOT include internal_id here This method is explicitly mentioned as a workaround in the knowledge sources, especially when you want to avoid running tests on certain columns and the built-in exclusion parameters are insufficient or problematic [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1650985870725969). So, replacing all_columns_anomalies with multiple column_anomalies tests for only the desired columns (excluding internal_id) is a valid and supported approach.