Skip to content

ENH: add interval kwarg to get_data_yahoo issue #9071 #9072

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 1 commit into from
Jan 5, 2015
Merged

ENH: add interval kwarg to get_data_yahoo issue #9071 #9072

merged 1 commit into from
Jan 5, 2015

Conversation

alexamici
Copy link
Contributor

PR for the issue #9071

@jreback jreback added Data Reader IO Excel read_excel, to_excel Enhancement and removed IO Excel read_excel, to_excel labels Dec 13, 2014
@jreback jreback added this to the 0.16.0 milestone Dec 13, 2014
@jreback
Copy link
Contributor

jreback commented Dec 13, 2014

needs some tests for this

@alexamici
Copy link
Contributor Author

The Travis CI builds fail for an import error in an unrelated module. The PR pass all tests locally.

@jreback OK

@jreback
Copy link
Contributor

jreback commented Dec 13, 2014

you have to add tests to the PR

@alexamici
Copy link
Contributor Author

Added tests for 'monthly', 'dividend' and invalid intervals in test_get_data_interval.

@alexamici
Copy link
Contributor Author

@jreback I think the PR is ready for merge, the Travis CI failures "ERROR: Failure: ImportError (cannot import name json)" are unrelated to my change. All tests related to the pandas.io.data module pass on my machine with python2.7 and python3.4.

Is there anything more I can do?

@jreback
Copy link
Contributor

jreback commented Dec 28, 2014

pls add a release note (enhancements section, referencing the issue).

rebase on master and you should be good. ping on green.


# dividend data
pan = web.get_data_yahoo('XOM', '2013-01-01', '2013-12-31', interval='v')
self.assertEqual(len(pan) == 4)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add tests for the other two interval possibilities?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Yahoo! CSV API is the same for 'd', 'w' and 'm' interval values, so testing one is enough to exercise all code in the function. The reason I added a second call with 'v' is that Yahoo! replies with a different CSV format in this case and that assures that it is handled by the same code without errors.

In my opinion it is not particularly useful to add more tests, but if you think it is necessary please tell me and I'll do it.

@alexamici
Copy link
Contributor Author

Hopefully I did the rebase correctly.

I can't make sense of the Travis CI errors, some are unrelated to my changes and at least one appears to be a temporary failure of Yahoo! CSV API. I used the changes extensively a few days ago, so I'm quite confident of the code, but I experienced intermittent failures of the CSV API today.

IMO the PR can be merged as is. Thanks.

@jreback
Copy link
Contributor

jreback commented Jan 2, 2015

@alexamici well it appears to be failing on the routine you changed.

@alexamici
Copy link
Contributor Author

@jreback short story: this is quite embarrassing, but the test function I wrote was total crap and I didn't notice as it was being skipped in my local testing. Now all should be well.

Long story: to my partial excuse I usually use py.test assert or doctests so I had no prior experience with assertEqual and friends, and I made a mess of the test function. Furthermore when running locally my tests were skipped due to lxml missing and I didn't figure it out until today. Last but not least, I was using the 'GOOG' symbol that has been redefined recently and queries for 2013 resulted in a Yahoo! API failure.

@jorisvandenbossche
Copy link
Member

Tests are passing now! @jreback this is OK?

jreback added a commit that referenced this pull request Jan 5, 2015
ENH: add interval kwarg to get_data_yahoo issue #9071
@jreback jreback merged commit 389b022 into pandas-dev:master Jan 5, 2015
@jreback
Copy link
Contributor

jreback commented Jan 5, 2015

thanks @alexamici !

@jreback
Copy link
Contributor

jreback commented Jan 5, 2015

btw, if you would like to review the docs in remote.rst for any updates
(looking for a general review, not necessarily tied to this change).

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

Successfully merging this pull request may close these issues.

3 participants