-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
#1031 Add macro to add table description from schema.yml for BQ #1285
#1031 Add macro to add table description from schema.yml for BQ #1285
Conversation
This relates to #1031 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, happy to discuss
@drewbanin made the changes you asked and I'll start trying to test it |
Also make changes to table_options macro based on testing against a real project.
@drewbanin I got this working now. I also added the Can you take a look and tell me what you think? |
@darrenhaken just gave this a look and tried it out locally -- it's really great!! I have a couple of small recommendations, but overall, I really like the way this is taking shape.
Adding descriptions is effectively "free" on BQ, but it will require extra queries in databases like Snowflake and Redshift. This is a pretty powerful thing to be able to do with a one line code change!
dbt will fail with an error like: I think instead, we can add some code to the
So, this is looking really close! Happy to discuss :) |
Change `table_options` to have better error handling.
@drewbanin I've pushed changes based on your comments and now you can set However, I've encountered an issue when testing out the error handling logic.
It looks like the error is coming from https://github.com/fishtown-analytics/dbt/blob/61c345955ee6f6a80504d8e9abef9e7267e38b0e/core/dbt/parser/source_config.py#L97 |
@darrenhaken good catch! This change might be a tiny bit outside the scope of your PR, but it would be a good thing to fix for sure. This code confirms that the config collector is a dict. We could add another assertion here which ensures that the
That would result in an error message like:
This isn't the best error message in the world, but it's certainly better than |
Quick thought here, I agree totally on fixing this, but it should almost certainly be more like:
There are a lot of valid values we might end up wanting to insert there in the code that are not edit: I do agree that the initial |
@beckjake like this?
or will the try replace the if statement? |
@darrenhaken Yup! Assuming I'm not missing anything and it works ok, of course |
@beckjake i think it makes sense to just do the try without the if |
This resolves the issue that `{{ config(persist_docs=true) }}` would not raise a useful exception.
OK I've pushed, can you take a look? @drewbanin / @beckjake . Did some testing and it seems to work |
if you skip the |
@beckjake so this?
|
@beckjake pushed, please review when you can |
It looks like you'll have to update the docs generate tests, I think you'll need to change this bit: Otherwise, this PR looks fine to me. |
Great, are there any other tests needed?
I’m unsure what the testing approach/coverage is like around the Python
changes.
…On Tue, 19 Feb 2019 at 16:56, Jacob Beck ***@***.***> wrote:
It looks like you'll have to update the docs generate tests, I think
you'll need to change this bit:
https://github.com/fishtown-analytics/dbt/blob/dev/stephen-girard/test/integration/029_docs_generate_tests/test_docs_generate.py#L785-L794
to include 'persist_docs': {},
Otherwise, this PR looks fine to me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1285 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA6Me9S1-xrj9woxCaV5yl2ZVB7hPXDeks5vPCzUgaJpZM4azD9s>
.
|
@darrenhaken I'd recommend just updating some of the BQ test models to persist their docs. Some good candidates are:
You'll also need to provide documentation for these models in a schema.yml file to make sure the docs are persisted. As long as the models run without error, I'd be ok with merging this. |
@drewbanin I've made the changes but I wasn't sure how I ran the tests locally for the test suite. Will the CI build pick these up? Also if you can review that would be great |
@darrenhaken looks like these tests are failing in AppVeyor: https://ci.appveyor.com/project/DrewBanin/dbt/builds/22720326 I think the big problems is just that Here's one example of a place where the integration test isn't expecting to see a I think the best way to proceed is to get the test suite running on BQ for you locally. Let's chat on Slack, happy to help you get set up! This should also be a helpful resource: https://github.com/fishtown-analytics/dbt/blob/dev/stephen-girard/CONTRIBUTING.md#testing So, this is super close! Let me know how i can help get it over the line :) |
@drewbanin to test locally do I need to fill in all the BigQuery fields:
|
@darrenhaken yep! We should fix this, but it's a function of how we need to set up our CI tools. Circle/AppVeyor et al let you put in Environment Variables, but I don't think we can just paste in a whole Service Account JSON file (I can check on this). Pasting in the service account file keys one-by-one is kind of annoying, but once it's done you never have to think about it again! |
@drewbanin Alright I'm giving it a shot now, I'll keep you posted 👍 |
pep8
…dbt into dev/stephen-girard
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Can I do anything to help get this merged? |
re-opened in #1532 to bring this up-to-date with recent dbt changes + test fixes |
WIP in progress. @drewbanin please take a look