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

Add relation name to the exception in case of archive failure #1205

Conversation

vijaykiran
Copy link
Contributor

Fixes #1066

Sample output

Compilation Error in archive users_archived (dbt_project.yml)
  The relation`production_data.users` was not found!
  Check that the relation exists and that your user has permissions to select from this relation.

  > in macro materialization_archive_default (macros/materializations/archive/archive.sql)
  > called by archive users_archived (dbt_project.yml)

@drewbanin drewbanin self-requested a review January 2, 2019 14:06
@drewbanin
Copy link
Contributor

Thanks for the PR @vijaykiran - this looks great :)

One tiny comment, but happy to merge this once that's addressed

dbt/exceptions.py Outdated Show resolved Hide resolved
@@ -174,7 +174,8 @@
identifier=target_table) -%}

{%- if source_relation is none -%}
{{ exceptions.missing_relation(source_relation) }}
{%- set source_relation_name = [source_schema, source_table]|join(".") -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

In our Wilt Chamberlain release, we're going to make archive database-aware, meaning that this will become database.schema.table. I think this is ok for now, but wanted to raise that point for when we revisit this in the future. See here: #838

@vijaykiran
Copy link
Contributor Author

Meh. Seems like something odd going on, I'll fix the commits.

@drewbanin
Copy link
Contributor

Hey @vijaykiran - I'm going to close this PR. We went ahead and overhauled Archival, and I think this particular issue (#1066) was fixed in the process!

Thanks for opening this in the first place, and sorry it didn't make it in!

@drewbanin drewbanin closed this Apr 30, 2019
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