Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dbt): Supporting sync columns with --preserve-metadata and --merge-metadata #268

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

Vitor-Avila
Copy link
Contributor

The --preserve-metadata and --merge-metadata flags can be used with the dbt sync command so that Superset metadata (specially metrics) is not automatically discarded during the sync. To support this flow, currently these two flags invoke the update_dataset() method with reload_columns=False. This is intentionally implemented so that the groupby, filterable and other configurations are not reset to default.

The issue with this approach is that the dataset columns are not synced, so in case the model was modified to include a new column (or a column was removed) this change won't reflect to Superset automatically.

This PR updates these two flags so that columns are now synced while still preserving the column metadata. It also refactors the sync_datasets() method to break down all required actions into helper methods.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for the refactor!

@Vitor-Avila Vitor-Avila merged commit 73db090 into main Mar 18, 2024
4 checks passed
@Vitor-Avila Vitor-Avila deleted the preserve-and-sync branch March 18, 2024 12:49
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