-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Bump influxdb-client dependency to 1.24.0 #63397
Conversation
Ah shoot forgot to update the manifest, so I guess my test was invalid. Give me a moment, sorry about that. |
Ok that's rather amusing. Looks like a bit of a surprise breaking change for us. We were passing timeout as So I will also have to make a small change as part of this PR to account for that. |
So have been digging into this, appears something changed which broke the tests between 1.21.0 and 1.22.0. Went up release by release and that's where the failures start. Will need to update them as well I suppose, hopefully its small. Didn't expect this to be so involved but I guess that's how it goes with dependency upgrades sometimes. |
Ok figured it out. It appears release 1.22.0 brought some significant improvements to error handling. I remember struggling with that initially and figuring out what exceptions to catch in each situation mostly by trial and error. Now there is one exception class the author has normalized everything to which is great, I'll do some refactoring in a future PR. The one downside is the new Exception class didn't account for scenarios that really only come up in testing. Namely someone tries to create an instance of ApiException but doesn't have an actual HTTPResponse which is what the tests were doing to create mock exceptions. Solving this required a small tweak to the tests, passing a The issue is actually already fixed in dev tip by influxdata/influxdb-client-python#375 but I'm not sure when the next release is. Figured it was better to get up to date since this only warranted a minor change and now error handling needs a refactor anyway. |
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.
Thanks, @mdegat01 👍
Happy New Year 🍾
Proposed change
Update
influxdb-client
dependency from1.14.0
to 1.24.0 (full changelog). Used for communication with InfluxDB 2.0 deployments.Note that there were breaking changes in 1.18.0. I have reviewed them and they were to APIs we don't use. I also tested locally and confirmed things work fine.
One nice addition is influxdata/influxdb-client-python#264 as it means users can now use the more user-friendly and easier to find name instead of tracking down the ID. We don't have to do anything else to make use of this, ID still works and now name does too. Other then that mostly bugfixes from our perspective.
Notes on included code changes:
__init__.py
is due to No request timeout causing points not being written to influxdb influxdata/influxdb-client-python#221 . The code was passing a value for timeout in seconds since that's what the V1 client wanted. It appears the V2 client wants milliseconds but timeout simply didn't work before. Now that it does we must correct the value.ApiException
could no longer be created without an HTTPResponse. This is a scenario that only comes up in tests but we were relying on it. Modified the tests to pass aMagicMock
to stop theNoneType
exception.Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: