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

fix the ambiguous alias exception to respect databases #2387

Merged
merged 2 commits into from
May 4, 2020

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented May 1, 2020

resolves #2326

Description

Fixes the ambiguous alias exception so now it respects databases

  • The alias name check is now tied to the behavior of adapter.Relation.create_from(...)
  • Plugins that override the include of their relations will use whatever they render to for the check the actual exception-raising code gets the name that was compared instead of generating its own
  • Finally, I added a reasonable fallback behavior since this method was exposed to the context

Checklist

  • I have signed the CLA
  • 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
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

The alias name check is now tied to the behavior of adapter.Relation.create_from(...)
Plugins that override the `include` of their relations will use whatever they render to for the check
the actual exception-raising code gets the name that was compared instead of generating its own
Finally, I added a reasonable fallback behavior since this method was exposed to the context
@cla-bot cla-bot bot added the cla:yes label May 1, 2020
@beckjake beckjake requested a review from drewbanin May 1, 2020 18:19
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

LGTM!

@beckjake
Copy link
Contributor Author

beckjake commented May 4, 2020

Merging this before tests - just a changelog update

@beckjake beckjake merged commit 595c82c into dev/octavius-catto May 4, 2020
@beckjake beckjake deleted the fix/ambiguous-alias-exception branch May 4, 2020 13:19
@azhard
Copy link
Contributor

azhard commented May 4, 2020

This feature is currently blocking my team from launching dbt as we have multiple BigQuery biews with the same view name & dataset name but different project (database).

Just curious about rough timeline for when this will be released in a new version of dbt?

@drewbanin
Copy link
Contributor

hi @azhard - this change will go out in our next release, dbt v0.17.0. We'll be cutting the first pre-release today, and the final release will be live at the end of the pre-release period (as soon as two weeks from now, but the exact date depends on how testing goes).

@azhard
Copy link
Contributor

azhard commented May 4, 2020

That's awesome - thanks for the quick reply @drewbanin, really appreciate it!

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.

Ambiguous alias exception should check database config
3 participants