-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: use correct args and kwargs definitions #256
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ class Visits(Resources): | |
@overload | ||
def find( | ||
self, | ||
*, | ||
content_guid: str = ..., | ||
min_data_version: int = ..., | ||
start: str = ..., | ||
|
@@ -119,7 +120,7 @@ def find( | |
... | ||
|
||
@overload | ||
def find(self, *args, **kwargs) -> List[VisitEvent]: | ||
def find(self, **kwargs) -> List[VisitEvent]: | ||
"""Find visits. | ||
|
||
Returns | ||
|
@@ -128,15 +129,14 @@ def find(self, *args, **kwargs) -> List[VisitEvent]: | |
""" | ||
... | ||
|
||
def find(self, *args, **kwargs) -> List[VisitEvent]: | ||
def find(self, **kwargs) -> List[VisitEvent]: | ||
"""Find visits. | ||
|
||
Returns | ||
------- | ||
List[Visit] | ||
""" | ||
params = dict(*args, **kwargs) | ||
params = rename_params(params) | ||
params = rename_params(kwargs) | ||
|
||
path = "/v1/instrumentation/content/visits" | ||
url = self.url + path | ||
|
@@ -153,6 +153,7 @@ def find(self, *args, **kwargs) -> List[VisitEvent]: | |
@overload | ||
def find_one( | ||
self, | ||
*, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question about the places we're adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to say, all arguments after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what we want since positional argument can change over time. |
||
content_guid: str = ..., | ||
min_data_version: int = ..., | ||
start: str = ..., | ||
|
@@ -178,7 +179,7 @@ def find_one( | |
... | ||
|
||
@overload | ||
def find_one(self, *args, **kwargs) -> VisitEvent | None: | ||
def find_one(self, **kwargs) -> VisitEvent | None: | ||
"""Find a visit. | ||
|
||
Returns | ||
|
@@ -187,15 +188,14 @@ def find_one(self, *args, **kwargs) -> VisitEvent | None: | |
""" | ||
... | ||
|
||
def find_one(self, *args, **kwargs) -> VisitEvent | None: | ||
def find_one(self, **kwargs) -> VisitEvent | None: | ||
"""Find a visit. | ||
|
||
Returns | ||
------- | ||
Visit | None | ||
""" | ||
params = dict(*args, **kwargs) | ||
params = rename_params(params) | ||
params = rename_params(kwargs) | ||
path = "/v1/instrumentation/content/visits" | ||
url = self.url + path | ||
paginator = CursorPaginator(self.session, url, params=params) | ||
|
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.
are these *args additions just for forwards / backwards compatibility?
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.
See below first. This is the equivalent to *, except in this case we have to include *args to match the update signature.