-
Notifications
You must be signed in to change notification settings - Fork 33
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
lazy-load api version upon first call rather than instantiation #225
base: develop
Are you sure you want to change the base?
Conversation
Since we don't have CI setup, here are the test results:
|
@@ -110,15 +110,13 @@ def __init__( | |||
self.users = App(self, "users") | |||
self.plugins = PluginsApp(self) | |||
self.graphql = GraphQLQuery(self) | |||
self._validate_version() |
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.
By removing this in the init, we no longer validate the version unless the end user explicitly calls the property themselves now (barring a single method that I could find). Can we make every call get the .version
property so it will trigger the _validate_version
method on the first one and just return the cached property on every other one?
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.
@brandomando on this one...
Fixes #201
With this change, the API version check will not run until the first API call, rather than at instantiation. This allows the user to manipulate the underlying HTTP session before the first API call is made. In #201 , the use case is to apply a proxy configuration prior to making the first call.