<@U088WCP3B4P> I am adding `schema_changes_from_ba...
# ask-elementary-ai
r
@kapa.ai I am adding
schema_changes_from_baseline
on a external table source, and one of the column type is mentioned
VARCHAR(1024)
in contract, also external table has the same, but the test is considering the column as
CHARACTER VARYING
and showing mismatch . Any idea why this is happening?
k
A message from kapa.ai
Short answer: this is expected behavior. Elementary normalizes Snowflake/Postgres text types, so VARCHAR/CHARACTER VARYING (and NVARCHAR/STRING on Snowflake) are treated as the same “TEXT” family rather than comparing length or the exact warehouse-specific spelling. That’s why you see CHARACTER VARYING in the test output even if your contract shows VARCHAR(1024). On Snowflake, Elementary explicitly maps STRING, VARCHAR, and NVARCHAR to TEXT, so a change like VARCHAR(MAX) to VARCHAR(x) doesn’t flag by default. If you need stricter length/type enforcement, the knowledge sources don’t document support for that today (and Databricks/Spark aren’t supported for these schema tests). ([Schema changes from baseline](https://docs.elementary-data.com/data-tests/schema-tests/schema-changes-from-baseline)). Related notes from prior discussions: - In Snowflake, VARCHAR vs TEXT are treated synonymously by Elementary; datatype changes like VARCHAR(MAX) → VARCHAR(x) aren’t flagged by default (support confirmed this behavior) ([Slack thread](https://slack.com/archives/C02CTC89LAX/p1689814382480289)). - Historical issues where VARCHAR vs CHARACTER VARYING caused false “type changed” messages were addressed in later versions; ensure you’re on an updated Elementary package if you still see mismatches purely due to naming differences ([Slack thread](https://slack.com/archives/C02CTC89LAX/p1679319966726349)). If your warehouse is Databricks/Spark, schema changes tests aren’t supported (except Databricks with Unity Catalog, per docs), which can also explain unexpected results ([Docs](https://docs.elementary-data.com/data-tests/schema-tests/schema-changes-from-baseline), [Slack note](https://slack.com/archives/C02CTC89LAX/p1695800200373959)).
r
@kapa.ai in which version this is fixed?
k
A message from kapa.ai
I’m sorry, but the knowledge sources don’t state the exact version where the VARCHAR vs CHARACTER VARYING normalization/mismatch was fixed. They mention that: - Elementary treats text-type synonyms as equal (e.g., VARCHAR/TEXT/NVARCHAR/STRING) and does not flag length differences like VARCHAR(MAX) vs VARCHAR(x) by default, but no specific version is given for when this behavior was introduced or fixed ([Schema changes](https://docs.elementary-data.com/data-tests/schema-tests/schema-changes)). - A related mismatch issue was discussed and later addressed “in one of the latest versions,” but without a precise version number; users were advised to run dbt deps to update and retest ([Slack thread](https://slack.com/archives/C02CTC89LAX/p1679319966726349)). - Another dashboard counting bug was fixed in Python 0.7.5 / dbt package 0.7.2, but that’s unrelated to type synonym handling ([Slack thread](https://slack.com/archives/C02CTC89LAX/p1676946903124339)). If you can share your current Elementary dbt package version, I can suggest upgrading to the latest available in your project and re-running dbt deps, as prior Slack guidance resolved similar schema type display issues by upgrading ([Slack thread](https://slack.com/archives/C02CTC89LAX/p1679319966726349)).