-
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
Add dbt plugin version #2279
Add dbt plugin version #2279
Conversation
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Sumanau Sareen.
|
dc72494
to
7af8e35
Compare
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
7af8e35
to
0802a87
Compare
Cool! One thing is that I think I'd rather avoid using
Then we'd add a My code is just demo code - obviously you'd need to handle the case where A key element of my thought process here is that I don't want dbt to have to know the names when when it starts looking for versions! That's the nice feature of this model - if a user writes a third-party plugin, dbt will still report its version in |
Agree with your approach of using importlib.
Now as per Pep 396, this is the advisable approach to define version and also setup.py should also read version from the same file, but as the pep specification are voluntarily, so its not widely adopted. What if we can use importlib to find dbt plugins and then instead of reading version.py we instead read the version from pkg_resource, OR we can increase the scope of this PR to add documentation explaining its recommended that dbt plugins always define a version.py file, which is what you are recommending as well. thoughts ? |
At least in the short term, I think we should just require ignore plugins that don't have it. That way this isn't a breaking change (always nice!). In the future we might want to make it a hard requirement (perhaps we'll want to inject the adapter plugin version into the context or something), but I don't see any reason to do so right now. One thing we can do is make sure the changelog update is explicit, something like:
We can expand on it in the "upgrading to dbt 0.17.0" page in the docs if we find that compelling. I think in general those will suffice. |
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.
This isn't me prodding you or adding to the previous feedback - I'm just setting this so our github reviews plugin leaves me alone 😄
No issues, i plan to finish pending PR over this weekend, got quite busy from last few days. |
0802a87
to
f3f3337
Compare
@beckjake I couldn't get importlib to work as expected, hence taking your idea of not hardcoding the plugin names i have used pkg_resources to implement the same, this time only hard-coding the keyword |
f3f3337
to
a85fe6c
Compare
The problem with that approach is that not all packages that start with I'm pretty confident
I'm think that once you do that, you can just take the code I suggested in a previous comment, paste it in place of |
a85fe6c
to
8a5f5d8
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Sumanau Sareen.
|
8a5f5d8
to
5d5913e
Compare
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.
This looks great! Can you update the CHANGELOG.md file to reflect your additions?
The CHANGLEOG update should be like the rest of the changelog entries: A quick summary - Add dbt plugin versions to --version
should be fine, a link to this PR+issue, and an addtion to the Contributors
section with your github username + a link to this PR.
Once you do that, I'll kick off the rest of the tests and then this will be good to go into 0.17.0!
Thanks for contributing to dbt 😄
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Sumanau Sareen.
|
fe3b75e
to
11a86c5
Compare
@beckjake updated. |
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.
Almost there! This is annoying, but can you remove the spaces between these? Otherwise github won't render them.
11a86c5
to
10d2019
Compare
Co-Authored-By: Jacob Beck <beckjake@users.noreply.github.com>
I've kicked off tests, they should start showing up on github as passing in a minute or two |
resolves #2272
Description
Add DBT plugins version information in
get_version_information
Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.