-
Notifications
You must be signed in to change notification settings - Fork 9
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: 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. |
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.
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
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) |
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.
Please simplify this to something like:
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) |
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.
Yes. The connection_string
is a better solution. Changed.
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 🚀
Proposed Changes
user-agent
value toinfluxdb3-python/{VERSION}
version.py
to directoryinfluxdb_client_3
user-agent
value to_flight_client
. Note thatgrpc
library underlyingpyarrow
also adds auser-agent
header 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