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 dynamic schema names rather than hardcoded ones #223

Closed
dbeatty10 opened this issue Nov 22, 2024 · 0 comments · Fixed by #224
Closed

Use dynamic schema names rather than hardcoded ones #223

dbeatty10 opened this issue Nov 22, 2024 · 0 comments · Fixed by #224
Labels
enhancement New feature or request

Comments

@dbeatty10
Copy link
Contributor

Describe the feature

To allow all schemas to be PR-specific, replace any hardcoded schema names with the dynamic target.schema that comes from the dbt connection profile.

Additional context

In our CI tests, we have steps like this:

dbt --warn-error run-operation create_source_table

Within that macro, we create a schema named codegen_integration_tests__data_source_schema (which is a hard-coded name):

{% set target_schema=api.Relation.create(
database=target.database,
schema="codegen_integration_tests__data_source_schema"
) %}

This could lead to permissions errors if different database users are trying to modify this schema.

Who will this benefit?

This will benefit maintainers that want CI tests to be reliable and robust rather than finicky.

In particular, I think it will help overcome permissions errors faced in these PRs:

Are you interested in contributing this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant