-
Notifications
You must be signed in to change notification settings - Fork 30
Changes so request_kwargs can be input to pandas #304
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
Conversation
|
Example usage: Read in for I wasn't sure how to make a test for this that just checked to make sure the keywords made it through. |
|
@ocefpaf if you get a moment could you see what you think of this? |
erddapy/erddapy.py
Outdated
| response = kw.pop("response", "csvp") | ||
| url = self.get_download_url(response=response, **kw) | ||
| return to_pandas(url, pandas_kwargs=dict(**kw)) | ||
| url = self.get_download_url(response=response, **(distinct_kwargs or {})) |
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.
distinct should not be a kw. I guess we never noticed. We should make the default False and make it a regular arg. Do you mind adding that to your PR?
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.
Ok I changed that in erddapy.py but didn't make changes in url.py in case that would cause some backward incompatibility issues, but I could propagate it through if you want.
|
@ocefpaf Does this look ok to you at this point? Note that I didn't change any of the other |
|
Ping @ocefpaf 😅 I'm using this locally for now but eventually will need to be able to use it otherwise so just want to keep this around. |
|
@ocefpaf Might you have a chance to merge this? I hope it is ready to go. |
40d37bf to
046a8b0
Compare
quote> quote> Current you cannot input a keyword argument like "timeout" to urlopen because requests_kwargs and pandas_kwargs are not distinguished. Or, actually, in erddapy.py they are all just "**kw". The present changes make it so you can input keyword arguments to pandas, still not in a dict like it was, but can also specify keyword arguments to requests_kwargs. quote> quote> Notes: quote> * it looks like similar changes could happen in some of the other to_* functions but not sure and have not used those as much. quote> * I see that requests_kwargs could instead be input to ERDDAP directly, but then that is not subsequently used. Not sure if both approaches should be allowed?
046a8b0 to
0e33e77
Compare
|
My internal handling/passing of all the kw is still messy but I think things are a bit more consistent now. |
|
Thanks @ocefpaf! |
Currently you cannot input a keyword argument like "timeout" to urlopen because requests_kwargs and pandas_kwargs are not distinguished. Or, actually, in erddapy.py they are all just "**kw". The present changes make it so you can input keyword arguments to pandas, still not in a dict like it was, but can also specify keyword arguments to requests_kwargs.
Notes: