Skip to content

Make lowercase columns default, add option to make them same as model #140

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 6 commits into from
Jan 17, 2018

Conversation

lsetiawan
Copy link
Member

Overview

This PR Addresses #127 (comment). Now getResultValues and getDatasetsValues have an additional argument called lowercols, which defaults to True to keep the api the same, and make changes less disruptive. I have tested this and it works.

I was wondering if I should create some sort of warning here too saying how this argument will be deprecated in the next release after this one, and the *values dataframe will default to columns similar to the model in future releases, therefore user have to add lowercase=False to anticipate for that?

@lsetiawan lsetiawan requested a review from emiliom January 10, 2018 16:57
@emiliom
Copy link
Member

emiliom commented Jan 10, 2018

I was wondering if I should create some sort of warning here too saying how this argument will be deprecated in the next release after this one, and the *values dataframe will default to columns similar to the model in future releases, therefore user have to add lowercase=False to anticipate for that?

YES! That'd be perfect. Though at this time we don't need to be specific about which release it'll be deprecated on. We can say "soon" or "in the near future", then once a decision is made about a timeframe, we can change the warning to be more specific.

Regarding getDatasetsValues : I didn't realize that function was also impacted by this issue/decision. But I guess I hadn't really thought about or examined that function. Thanks for making the two functions consistent.

@lsetiawan
Copy link
Member Author

Is this warning message okay?

'The parameter \'lowercols\' default makes the column names lowercase. '
 'Please set this to False. \'lowercols\' will be deprecated in the near future; '
 'column names casing will then be similar to its respective model.'

@emiliom
Copy link
Member

emiliom commented Jan 11, 2018

@lsetiawan See the conflicts that were identified by github. I'll hold off on reviewing this PR until the conflict is resolved. Thanks.

@@ -933,6 +933,8 @@ def getDataSetsValues(self, ids=None, codes=None, uuids=None, dstype=None):
uuids (list, optional): List of Dataset UUIDs string.
dstype (str, optional): Type of Dataset from
`controlled vocabulary name <http://vocabulary.odm2.org/datasettype/>`_.
lowercols (bool, optional): Make column names to be lowercase.
Default to True.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this at the end of the lowercols description: "Please start upgrading your code to rely on CamelCase column names. In a near-future release, the default will be changed to False, and later the parameter may be removed.

@@ -1347,6 +1349,8 @@ def getResultValues(self, resultids, starttime=None, endtime=None):
resultids (list): List of SamplingFeatureIDs.
starttime (object, optional): Start time to filter by as datetime object.
endtime (object, optional): End time to filter by as datetime object.
lowercols (bool, optional): Make column names to be lowercase.
Default to True.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this at the end of the lowercols description: "Please start upgrading your code to rely on CamelCase column names. In a near-future release, the default will be changed to False, and later the parameter may be removed.

@emiliom
Copy link
Member

emiliom commented Jan 12, 2018

See my suggested changes to a couple of doc strings. If you agree with them, go ahead and merge this PR yourself once you've made that addition. Thanks!

@lsetiawan
Copy link
Member Author

@ocefpaf For some reason, Travis CI is not starting, I've been waiting for it for few hours, I restarted it after about an hour. Do you know what's going on? Thanks!

@ocefpaf
Copy link
Member

ocefpaf commented Jan 16, 2018

@lsetiawan take a look at their status bot on Twitter. It seems that they had an incident a while ago:

https://twitter.com/traviscistatus

@lsetiawan
Copy link
Member Author

Oh okay. Good to know. I'll just let it do it's thing then. Thanks!

@lsetiawan
Copy link
Member Author

Travis finally worked. Merging.

@lsetiawan lsetiawan merged commit f634574 into ODM2:development Jan 17, 2018
@lsetiawan lsetiawan deleted the fix_grv branch January 17, 2018 16:06
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.

3 participants