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

get_tables_by_prefix, ideal for union_tables jobs #36

Merged
merged 1 commit into from
Jan 8, 2018

Conversation

jdub
Copy link
Contributor

@jdub jdub commented Jan 7, 2018

Solution suggested by @drewbanin, enhanced with "exclude" parameter.

@jdub
Copy link
Contributor Author

jdub commented Jan 7, 2018

This works great without the adapter_macro wrapper, but when I add it, I get this error:

Encountered an error:
not enough values to unpack (expected 2, got 1)

@drewbanin
Copy link
Contributor

@jdub this is great! I believe the not enough values to unpack (expected 2, got 1) error you're seeing was fixed in 0.9.1 (released 1/5). You could try upgrading to see if that fixes this.

Separately, I noticed a bug in how dbt implements adapter_macro which I think will prevent this particular macro from working correctly (for now).

I think the best solution in the short term would be to nix the adapter_macro approach, and instead just place the get_tables_by_prefix macro somewhere like macros/sql/get_tables_by_prefix.sql.

If it makes sense to extend this macro to other adapters in the future, we can definitely do that without breaking backwards compatibility.

@jdub
Copy link
Contributor Author

jdub commented Jan 8, 2018

Not fixed in 0.9.1 sadly:

$ dbt --version
installed version: 0.9.1
   latest version: 0.9.1
Up to date!
$ dbt run --models awsbilling








  []

Encountered an error:
not enough values to unpack (expected 2, got 1)

Thanks -- I'll update with your suggested change.

@jdub jdub force-pushed the get_tables_by_prefix branch from ff1ed09 to a98b636 Compare January 8, 2018 00:43
@drewbanin
Copy link
Contributor

@jdub let me know when this is ready for another look. Can you also add documentation to the README.md file?

Solution suggested by @drewbanin, enhanced with "exclude" parameter.
@jdub jdub force-pushed the get_tables_by_prefix branch from a98b636 to ed461c6 Compare January 8, 2018 22:19
@jdub
Copy link
Contributor Author

jdub commented Jan 8, 2018

@drewbanin README updated, with a bit of alphabetical re-ordering for good measure. This is good to go.

@drewbanin
Copy link
Contributor

@jdub groovy - this LGTM! Merging

@drewbanin drewbanin merged commit be79713 into dbt-labs:master Jan 8, 2018
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