-
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
adapter compability messaging added. #4565
adapter compability messaging added. #4565
Conversation
Hey @nkyuray, thanks for contributing this! I will have more bandwidth to test this next Tuesday |
core/dbt/version.py
Outdated
plugin_update_msg = (" To update dbt-{} please run:\n" | ||
" pip install dbt-{} --upgrade\n\n".format(plugin_name, plugin_name)) |
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.
Love the really actionable feedback here! My only comment is that not all users install dbt via pip - I really like the idea of making the instructions easy, but it'd be confusing to give pip instructions to someone who installed dbt via Homebrew etc.
Not sure how to square that circle; perhaps we have to fall back to linking them to the docs?
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.
Looks like the pip message is provided as an example in the original feature request. But I agree with @joellabes 's fallback to docs idea here. It would make later updates easier also.
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.
Ok, then simply we need to put a link of related docs page, right?
Besides the yellow one will be added also.
Thanks.
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.
That would be perfect! Thanks @nkyuray
@nkyuray, we are thinking of getting this into the 1.0.2 release that aims to have an rc version later next week. We think more folks would appreciate and benefit from what you are adding here! Do you think you get time to work on it before that? If not we can either merge this in and leave the rest as an improvement or I am happy to update it a bit if you are okay with it! |
Hi @ChenyuLInx, Sorry I couldn't take time to work on this, but I will probably finalize it on Friday. |
Hi @nkyuray, please don't say sorry. Thank you so much for contributing this!! |
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.
Looks great except for one minor part that needs to be adjusted. Thanks for pushing this on the weekend!!!
core/dbt/version.py
Outdated
compatibility_msg = green('Up to date!') | ||
else: | ||
if installed.major == plugin_version.major: | ||
compatibility_msg = yellow('Update available!') |
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.
Maybe we also need to check whether a new version of the package is actually available? I just tested locally, and because my dbt-core
is 1.0.1
, but the latest dbt-snowflake
is only 1.0.0
, I will always get this warning even though there's no newer dbt-snowflake
package. I would just make the check above to be checking major and minor versions only instead of the whole version since we don't always release the patch version of the adaptors when we release dbt-core
.
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.
Agreed! I think we could take one of two approaches here:
- Compare
{major}.{minor}
only, to ensure that the plugin version is compatible with thedbt-core
version - Run PyPi requests for each installed plugin, to see what its latest available version is
In the future we'd want a combination of both, right? Goal being to say whether installed plugins are Latest compatible
with the installed dbt-core
version
I just run the tests and noticed a few minor flake8 checks failed. Currently, you have to run it by yourself. We are going to have some tutorial on getting this into your pre-commit hooks soon. |
Per CI run, it looks like the flake8 failures are just:
|
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.
updated compare and added pulling from PYPI. @nkyuray Thank you so much for doing this!!! Sorry we really want this change in 1.0.2 so I just changed it a bit myself.
* adapter compability messaging added. * edited plugin version compatibility message * edited test version for plugin compability * compare using only major and minor * Add checking PYPI and update changelog Co-authored-by: Chenyu Li <[email protected]> Co-authored-by: ChenyuLi <[email protected]>
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 is a great change! Thank you @nkyuray for the contribution, and @ChenyuLInx for seeing this through.
I think there are a few small intricacies that may require us to revisit this logic in the future. I left two comments with edge cases that come to mind. If those seem like quick fixes, all the better. In either case, I'm happy to move forward with the current logic for v1.0.2rc1.
if installed == plugin_version or ( | ||
latest_plugin_version and plugin_version == latest_plugin_version | ||
): |
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.
It's possible that plugins will put out patch releases before dbt-core
puts out a patch release. Imagine:
dbt-core==1.0.1
anddbt-synapse==1.0.2
are both available- I have
dbt-synapse==1.0.1
installed locally installed == plugin_version
will returnTrue
, at the same time, there's a compatible plugin update available
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.
I didn't realize this case, and the rule in the next comment, I will open a new issue and get these changes in
compatibility_msg = green('Up to date!') | ||
else: | ||
if latest_plugin_version: | ||
if installed.major == plugin_version.major: |
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.
dbt-core
+ plugins are compatible at the minor-version level. So I think this might want to be:
if installed.major == plugin_version.major: | |
if installed.minor == plugin_version.minor: |
If installed.minor != plugin_version.minor
, we'd want to raise red('Not compatible!')
* adapter compability messaging added. (#4565) * adapter compability messaging added. * edited plugin version compatibility message * edited test version for plugin compability * compare using only major and minor * Add checking PYPI and update changelog Co-authored-by: Chenyu Li <[email protected]> Co-authored-by: ChenyuLi <[email protected]> * fix changelog * fix changelog Co-authored-by: nkyuray <[email protected]>
* adapter compability messaging added. * edited plugin version compatibility message * edited test version for plugin compability * compare using only major and minor * Add checking PYPI and update changelog Co-authored-by: Chenyu Li <[email protected]> Co-authored-by: ChenyuLi <[email protected]> automatic commit by git-black, original commits: f3c7b6b
Description
adapter compatibility messaging added.
#4438 (comment)
Checklist
CHANGELOG.md
and added information about my change