feat: update user-agent and improve transport selection in queryClient#92
Merged
feat: update user-agent and improve transport selection in queryClient#92
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
==========================================
+ Coverage 7.01% 50.52% +43.51%
==========================================
Files 38 39 +1
Lines 2196 2276 +80
==========================================
+ Hits 154 1150 +996
+ Misses 2042 1126 -916 ☔ View full report in Codecov by Sentry. |
bednar
requested changes
Jun 6, 2024
Member
bednar
left a comment
There was a problem hiding this comment.
Thank you for your PR! 👍 There is just one requirement that needs to be met before we can merge it into the master branch:
influxdb_client_3/__init__.py
Outdated
Comment on lines
+158
to
+161
| if scheme == 'https': | ||
| self._flight_client = FlightClient(f"grpc+tls://{hostname}:{port}", **self._flight_client_options) | ||
| else: | ||
| self._flight_client = FlightClient(f"grpc+tcp://{hostname}:{port}", **self._flight_client_options) |
Member
There was a problem hiding this comment.
Please simplify this to something like:
Suggested change
| if scheme == 'https': | |
| self._flight_client = FlightClient(f"grpc+tls://{hostname}:{port}", **self._flight_client_options) | |
| else: | |
| self._flight_client = FlightClient(f"grpc+tcp://{hostname}:{port}", **self._flight_client_options) | |
| if scheme == 'https': | |
| connectionString = f"grpc+tls://{hostname}:{port}" | |
| else: | |
| connectionString = f"grpc+tcp://{hostname}:{port}" | |
| self._flight_client = FlightClient(connectionString, **self._flight_client_options) |
Contributor
Author
There was a problem hiding this comment.
Yes. The connection_string is a better solution. Changed.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed Changes
user-agentvalue toinfluxdb3-python/{VERSION}version.pyto directoryinfluxdb_client_3user-agentvalue to_flight_client. Note thatgrpclibrary underlyingpyarrowalso adds auser-agentheader so the two are merged. e.g.['grpc-c++/1.51.1 grpc-c/29.0.0 (linux; chttp2) influxdb3-python/0.6.0dev0']Checklist