Skip to content

feat: mimic dbt nuanced on_schema_change behavior#5203

Merged
eakmanrq merged 2 commits intomainfrom
eakmanrq/schema_differ_dbt
Aug 22, 2025
Merged

feat: mimic dbt nuanced on_schema_change behavior#5203
eakmanrq merged 2 commits intomainfrom
eakmanrq/schema_differ_dbt

Conversation

@eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented Aug 21, 2025

Addresses the gaps outlined in this PR: #5193

Key changes:

  • Allowed ConnectionConfig to be able to override the schema differ behavior. The dbt adapter then uses this to configure the schema differ to behave in a way that is compatible with dbt runtime.
  • SchemaDiffer can now be configured to ignore nested operations in order to mimic dbt behavior
  • SchemaDiffer can now be configured to configure alter operations to change column data type as "destructive" instead of "additive" in order to mimic dbt behavior

All of these changes are to support dbt adapter - there is not a good use case for them for native users.

The biggest gap remaining to support dbt on_schema_change is robust integration tests comparing dbt to dbt adapter to ensure they behave the same. Since this is runtime related, and we have loading errors to address, will prioritize this later as needed.

@eakmanrq eakmanrq force-pushed the eakmanrq/schema_differ_dbt branch 3 times, most recently from 7915a2f to 895af54 Compare August 21, 2025 17:03
SCHEMA_DIFFER = SchemaDiffer(
compatible_types={
SCHEMA_DIFFER_KWARGS = {
"compatible_types": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (and I guess this is also a matter of opinion): did you consider using the dict() constructor so you can keep treating the kwarg names as identifiers instead of strings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a preference either way. Just leaving how it is to save some time.

@eakmanrq eakmanrq force-pushed the eakmanrq/schema_differ_dbt branch from 674d9e5 to 1134354 Compare August 22, 2025 14:50
@eakmanrq eakmanrq enabled auto-merge (squash) August 22, 2025 14:55
@eakmanrq eakmanrq merged commit 5c252f3 into main Aug 22, 2025
28 checks passed
@eakmanrq eakmanrq deleted the eakmanrq/schema_differ_dbt branch August 22, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants