Skip to content

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

Merged
merged 8 commits into from
Jan 5, 2018
Merged

Fix builtins #137

merged 8 commits into from
Jan 5, 2018

Conversation

lsetiawan
Copy link
Member

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.

@lsetiawan lsetiawan requested a review from emiliom January 5, 2018 21:10
@@ -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):
Copy link
Member

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?

Copy link
Member Author

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.

@@ -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:
Copy link
Member

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.

Copy link
Member Author

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

@emiliom
Copy link
Member

emiliom commented Jan 5, 2018

simply put warnings to avoid breaking the API. All older code that uses the builtin arguments should still work.

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.

Copy link
Member

@emiliom emiliom left a 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.

@emiliom
Copy link
Member

emiliom commented Jan 5, 2018

I'll merge when the CI is completed.

@emiliom emiliom merged commit 65da961 into ODM2:development Jan 5, 2018
@lsetiawan lsetiawan deleted the fix_builtins branch January 5, 2018 22:54
@lsetiawan
Copy link
Member Author

Thanks @emiliom! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants