-
Notifications
You must be signed in to change notification settings - Fork 12
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
Small typing fixes #332
Small typing fixes #332
Conversation
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 see this is still in draft, but left one comment.
@property | ||
def base_url(self) -> str: | ||
return self._base_url |
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.
In base HTTP client we have a setter that enforces a trailing slash. Would be good to make sure these values are the same and perhaps enforce the trailing slash here instead:
workos-python/workos/utils/_base_http_client.py
Lines 209 to 216 in 6d7ab8c
@base_url.setter | |
def base_url(self, url: str) -> None: | |
"""Creates an accessible template for constructing the URL for an API request. | |
Args: | |
base_api_url (str): Base URL for api requests | |
""" | |
self._base_url = "{}{{}}".format(self._enforce_trailing_slash(url)) |
cc8478a
to
12e7793
Compare
Description
Note: This is stacked on #331
OK, the branch name is a little LOL
This started as an attempt to fix some of the stricter validations from pylance, like shadowing the
_http_client
type. This led to a bit of a rabbit hole, but here was the outcome:I'm not married to the bigger changes I made around removing the generics for the
BaseClient
, but I feel like this is a little more direct and easier to understand.Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.