-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[py] implement configurable configuration class for the http client #13286
base: trunk
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #13286 +/- ##
==========================================
- Coverage 58.48% 58.30% -0.18%
==========================================
Files 86 89 +3
Lines 5270 5430 +160
Branches 220 224 +4
==========================================
+ Hits 3082 3166 +84
- Misses 1968 2040 +72
- Partials 220 224 +4 ☔ View full report in Codecov by Sentry. |
7696a64
to
923208f
Compare
I had a circular dependency so I removed all references to Proxy from RemoteConnection and am calculating |
923208f
to
a57423a
Compare
def proxy(self) -> Proxy: | ||
""":Returns: The proxy used for communicating to the driver/server.""" | ||
|
||
self._proxy = self._proxy or Proxy(raw={"proxyType": ProxyType.SYSTEM}) |
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 looks like an unexpected side effect to me. Would it make sense to set the default value in the constructor?
elif self.proxy.proxy_type == ProxyType.SYSTEM: | ||
_no_proxy = os.environ.get("no_proxy", os.environ.get("NO_PROXY")) | ||
if _no_proxy: | ||
for npu in _no_proxy.split(","): |
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.
can we have better variable names? I have no idea what npu
means :)
if n_url.path in remote_add.netloc: | ||
return None | ||
if self.remote_server_addr.startswith("https://"): | ||
return os.environ.get("https_proxy", os.environ.get("HTTPS_PROXY")) |
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.
I believe this type of call might be extracted to a separate method, so there is less unnecessary code duplication
""" | ||
self._proxy = proxy | ||
|
||
def get_proxy_url(self): |
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.
can we define the type of the returned value?
self, | ||
remote_server_addr: str, | ||
keep_alive: bool = True, | ||
proxy=None, |
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.
the argument type is missing. also the spacing does not look correct
Description
Motivation and Context
Still need to implement: