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

Use redshift_connector's get_columns call to get column metadata #899

Merged
merged 16 commits into from
Sep 10, 2024

Conversation

mikealfare
Copy link
Contributor

@mikealfare mikealfare commented Aug 26, 2024

resolves #555

Problem

dbt-redshift references pg_catalog tables in its metadata queries. It should rely on Redshift's SDK or information_schema tables.

Solution

  • Retire references to pg_catalog behind a behavior flag
  • Move to SDK calls when possible
  • Fall back on SQL calls that avoid referencing pg_catalog

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

@mikealfare mikealfare self-assigned this Aug 26, 2024
@cla-bot cla-bot bot added the cla:yes label Aug 26, 2024
@mikealfare mikealfare changed the title changelog Replace references to pg_catalog Aug 29, 2024
@@ -65,6 +68,10 @@ class RedshiftAdapter(SQLAdapter):
}
)

@property
def _behavior_extra(self) -> List[BehaviorFlag]:
return [{"name": "retire_pg_catalog", "default": False}]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mikealfare mikealfare changed the title Replace references to pg_catalog Use redshift_connector's get_columns call to get column metadata Sep 9, 2024
@mikealfare mikealfare marked this pull request as ready for review September 9, 2024 23:38
@mikealfare mikealfare requested a review from a team as a code owner September 9, 2024 23:38
@mikealfare mikealfare merged commit 04bd2c0 into main Sep 10, 2024
30 checks passed
@mikealfare mikealfare deleted the remove-pg-catalog branch September 10, 2024 22:30
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.

[ADAP-726] [Feature] Remove references to pg catalogs in hard-coded queries
2 participants