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

Allow configuring snapshot table column names #145

Merged
merged 8 commits into from
Sep 20, 2024
Merged

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Sep 3, 2024

resolves #144

Problem

Supports configuration of snapshot column names provide by dbt-labs/dbt-core#10608

Solution

Update merge.sql to use modified columns names.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@gshank gshank requested a review from a team as a code owner September 3, 2024 20:01
@cla-bot cla-bot bot added the cla:yes label Sep 3, 2024
Copy link

github-actions bot commented Sep 3, 2024

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-postgres contributing guide.

mikealfare
mikealfare previously approved these changes Sep 18, 2024
pyproject.toml Outdated
@@ -54,7 +54,7 @@ path = "dbt/adapters/postgres/__version__.py"

[tool.hatch.envs.default]
dependencies = [
"dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git",
"dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@snapshot_column_names",
Copy link
Contributor

Choose a reason for hiding this comment

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

Friendly reminder to point back to main before merging.

@@ -2,12 +2,14 @@
{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}
{%- set insert_cols_csv = insert_cols | join(', ') -%}

{%- set stcn = config.get("snapshot_table_column_names") or get_snapshot_table_column_names() -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

get_snapshot_table_column_names is a new macro in dbt-adapters. We will need to bump the pin on the lower bound of dbt-adapters in dbt-postgres.

@mikealfare mikealfare dismissed their stale review September 18, 2024 16:29

I noticed that there was a new requirement on dbt-adapters in this PR, but there's no associated pin adjustment.

@mikealfare mikealfare merged commit d69a12f into main Sep 20, 2024
20 of 35 checks passed
@mikealfare mikealfare deleted the snapshot_column_names branch September 20, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable configuring snapshot table column names
3 participants