Skip to content
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

added tiingo csv response serialisation options #822

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tch
Copy link

@tch tch commented Aug 31, 2020

  • [y] closes Support CSV response format in Tiingo API #821
  • [y] tests added / passed *
  • [y] passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • [y] passes black --check pandas_datareader
  • [y] added entry to docs/source/whatsnew/v.0.9.1.txt
  • Tests added as 'formats' fixture parametrisations ('json', 'csv') in test_tiingo.py

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2020

Codecov Report

Attention: Patch coverage is 19.44444% with 29 lines in your changes missing coverage. Please review.

Project coverage is 63.27%. Comparing base (d2ef4e6) to head (1ffeeb1).
Report is 103 commits behind head on main.

Files with missing lines Patch % Lines
pandas_datareader/tiingo.py 7.40% 25 Missing ⚠️
pandas_datareader/tests/test_tiingo.py 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #822      +/-   ##
==========================================
- Coverage   64.67%   63.27%   -1.40%     
==========================================
  Files          62       62              
  Lines        2848     2775      -73     
  Branches      305      306       +1     
==========================================
- Hits         1842     1756      -86     
- Misses        932      945      +13     
  Partials       74       74              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@bashtage bashtage left a comment

Choose a reason for hiding this comment

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

Mostly looks good. Hard par tis testing it given the API key.

If no value is provided, defaults to 5min. The minimum value is "1min".
Units in minutes (min) and hours (hour) are accepted.
Re-sample frequency. Format is #min/hour; e.g. "15min" or "4hour".
If no value is provided, defaults to 5min. The minimum value is\
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove to \ and fix spacing.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

"1min".
Units in minutes (min) and hours (hour) are accepted.
response_format : str, default 'json'
Format of response data returned by the underlying Tiingo REST API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this accurate? Perhaps something like: "The format to use in the request tot he TIINGO API. "csv" results in smaller payload, less bandwidth, and may result in smaller charges for accessing the TIINGO API"

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good - added wording along those lines. This would affect bandwidth limits and implicitly charges.

@@ -83,12 +90,15 @@ def __init__(
"environmental variable TIINGO_API_KEY."
)
self.api_key = api_key
self.response_format = (
Copy link
Contributor

Choose a reason for hiding this comment

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

You should raise ValueError if not one of the expected values.

Copy link
Author

Choose a reason for hiding this comment

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

Good point - done!

@tch
Copy link
Author

tch commented Sep 1, 2020

Regarding testing. The API has free plan - it would be possible to setup dedicated key for automated tests ( https://api.tiingo.com/about/pricing )

@tch tch requested a review from bashtage September 1, 2020 12:15
@tch
Copy link
Author

tch commented Sep 10, 2020

Hi, Just a quick ping to check whether I am missing anything for this PR to get it merged for a release?

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.

Support CSV response format in Tiingo API
3 participants