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

throw a better error when a user tries to archive a nonexistent table #1066

Closed
drewbanin opened this issue Oct 17, 2018 · 1 comment · Fixed by #1361
Closed

throw a better error when a user tries to archive a nonexistent table #1066

drewbanin opened this issue Oct 17, 2018 · 1 comment · Fixed by #1361
Labels
bug Something isn't working enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors! snapshots Issues related to dbt's snapshot functionality

Comments

@drewbanin
Copy link
Contributor

Issue

Issue description

If a user tries to archive a non-existent table, dbt shows an error like:

Relation None not found!

Instead, this should show the name of the relation which was not found. It should also contextualize that this error occurred during archival.

Results

Saw:

Relation None not found!

Would like:

Error while running archive:
The relation to archive, `{schema}.{table}` was not found! Check that the relation exists, and that your user has permissions to select from this relation,

System information

The output of dbt --version:

0.11.x
@drewbanin drewbanin added bug Something isn't working enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors! snapshots Issues related to dbt's snapshot functionality labels Oct 17, 2018
@drewbanin drewbanin added this to the Wilt Chamberlain milestone Nov 28, 2018
vijaykiran added a commit to vijaykiran/dbt that referenced this issue Jan 2, 2019
vijaykiran added a commit to vijaykiran/dbt that referenced this issue Jan 2, 2019
vijaykiran added a commit to vijaykiran/dbt that referenced this issue Jan 3, 2019
@beckjake
Copy link
Contributor

A fun side effect of the new archive blocks feature is that this is magically fixed! 🎉

Because archives are now queries instead of configured, dbt just takes the raw query and tries to perform it, and the database gives you a pretty helpful error (well, I think so!):

Completed with 1 errors:

Database Error in archive foo (archives/test.sql)
  relation "not_a_schema.not_a_table" does not exist
  LINE 8:     select * from not_a_schema.not_a_table where status = 'c...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors! snapshots Issues related to dbt's snapshot functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants