-
Notifications
You must be signed in to change notification settings - Fork 13
Fix builtins #137
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 builtins #137
Conversation
odm2api/ODM2/services/readService.py
Outdated
@@ -379,21 +385,25 @@ def getVariables(self, ids=None, codes=None, sitecode=None, results=False): | |||
return None | |||
|
|||
# Method | |||
def getMethods(self, ids=None, codes=None, type=None): | |||
def getMethods(self, ids=None, codes=None, medtype=None, **kwargs): |
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.
medtype
seems like a misspelling, or else med
doesn't seem like a good shorthand for "method". How about mettype
or even better, full blown methodtype
?
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'll change to methodtype
. This is the most clear.
odm2api/ODM2/services/readService.py
Outdated
@@ -155,34 +157,38 @@ def getAnnotations(self, type=None, codes=None, ids=None): | |||
""" | |||
# TODO What keywords do I use for type. | |||
a = Annotations | |||
if type: | |||
if type == 'action': | |||
if 'type' in kwargs: |
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.
Should there be a warning if any other kwarg is passed, besides type
? ie, an unhandled/unrecognized kwarg name.
Not just in this function, but everywhere you use this scheme.
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'll see how to best handle unrecognized kwarg
Very nice scheme!! I really like it, specially how it creates a smooth deprecation path. I made a suggestion or two. I'll hold off on merging until you've had a chance to follow up. |
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.
Looks good. I'll merge in a bit.
I'll merge when the CI is completed. |
Thanks @emiliom! 👍 |
Overview
This PR addresses #115. I simply put warnings to avoid breaking the API. All older code that uses the builtin arguments should still work.