- Notifications
You must be signed in to change notification settings - Fork186
fix: url attribute type validation#672
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecov-commenter commentedSep 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install theCodecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@## master #672 +/- ##======================================= Coverage 90.47% 90.47% ======================================= Files 40 40 Lines 3526 3528 +2 =======================================+ Hits 3190 3192 +2 Misses 336 336
Flags with carried forward coverage won't be shown.Click here to find out more. ☔ View full report in Codecov by Sentry. |
bednar left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
@VitalyChait, thank you for your PR! 👍
Could you please add tests to cover your changes? This will ensure that your additions work as intended and maintain the integrity of the project.
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.
LGTM 🚀
3d70dbd
intoinfluxdata:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fix: added type validation to an attribute in client object
Proposed Changes
It is possible to pass "None" by mistake to the InfluxDBClient object.
I propose to do a quick sanity check on it.
Traceback example:
client_obj = InfluxDBClient(url=url, token=token, org=org)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "vitaly.chait/.local/lib/python3.12/site-packages/influxdb_client/client/influxdb_client.py", line 63, in init
super().init(url=url, token=token, debug=debug, timeout=timeout, enable_gzip=enable_gzip, org=org,
File "vitaly.chait/.local/lib/python3.12/site-packages/influxdb_client/client/_base.py", line 56, in init
if self.url.endswith("/"):
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'endswith'
Exception ignored in: <function InfluxDBClient.del at 0x7ff5627789a0>
Traceback (most recent call last):
File "vitaly.chait/.local/lib/python3.12/site-packages/influxdb_client/client/influxdb_client.py", line 319, in del
if self.api_client:
^^^^^^^^^^^^^^^
AttributeError: 'InfluxDBClient' object has no attribute 'api_client'
Checklist
pytest tests
completes successfully