-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat: Add database creation/deletion for Influx 1.8 #544
Open
Pitastic
wants to merge
11
commits into
influxdata:master
Choose a base branch
from
Pitastic:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+120
−4
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
815d37e
Create and Delete DB via v1
Pitastic f3f35e1
Auto fallback when buckets not supported
Pitastic b331328
Clean up coding style
Pitastic d13debe
Create and Delete DB via v1
Pitastic 90a7c62
Auto fallback when buckets not supported
Pitastic 69b6089
Clean up coding style
Pitastic db8a766
Merge branch 'rebase_543' of https://github.com/Pitastic/influxdb-cli…
Pitastic c94b316
Merge pull request #1 from Pitastic/rebase_543
Pitastic 71f0fdb
Implement version check
Pitastic 3609dc3
Merge pull request #2 from Pitastic/check_for_version
Pitastic 83deff4
fixes: check-code-style
Pitastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 approach is too general and can lead to user confusion. The better way would be to create a separate API for InfluxDB 1.8 something like
influxdb_18_api.py
.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 for reviewing.
I would disagree to create a separate API (If I understand your suggestion right). The goal should be that code changes are not necessary regardless of what version of InfluxDB a user uses (1.8 or 2.0 and above).
create_bucket()
should always succeed for both versions without extra error handling. Otherwise users could continue using the old influxdb-client for 1.8 and this one for >2.0 .My suggestion would be to implement a more specific exception handler. I agree that just
ApiException
is too general. I will have a look into the returnedApiException.code
.Would this be acceptable for your 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.
We can accept this if the behaviour will be described in the documentation. Instead of catching exception you can check the InfluxDB version, something like here:
influxdb-client-python/influxdb_client/service/_base_service.py
Line 28 in f3346d9