-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Fix bool conversion Verify parameter in Tableau Hook #17125
Conversation
Not directly related to the issue, but |
Oh really?! I didn't know. Thank you for the hint. I was thinking, what if we removed completely the conversion? I mean the admissible value for that
If the user will use for example What do you think? |
We can’t just remove functionality due to backward compatibility policy—we could deprecate it, but still need to keep the logic. So something like this is probably good enough: verify = self.conn.extra_dejson.get('verify', True)
if isinstance(verify, number.Number): # Also allow e.g. {"verify": 1}
verify = bool(verify)
elif isinstance(verify, str):
warnings.warn("blah blah parsing verify from a string is deprecated", DeprecationWarning)
from distutils.util import strtobool
verify = strtobool(verify)
else:
raise TypeError(f"verify needs to be a number, not {verify!r}") |
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
I am ok we do this in follow up PR too but we should definitely do it i.e replace strtobool |
Do we need deprecation? it was added in #16365 |
Yep. We have not released it yet. No deprecation needed. |
I am going to release an rc2 wave of July Providers shortly. |
Random failures. Merging. |
Hello all,
During the RC tests, I founded this bug (generated from my PR #16365). The bug is present when the user set in
Extra
parameter field in aTableau Connection
the parameterVerify
equals tofalse
ortrue
. During the JSON parsing, the value is automatically read asbool
, so the explicit conversionstr
tobool
is not necessary.Code changes:
Verify
parameterThank you