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

Add PricesBase.to_csv to export prices to csv, also various fixes #286

Merged
merged 7 commits into from
Feb 15, 2024

Conversation

maread99
Copy link
Owner

Adds PricesBase.to_csv method to provide for exporting data to .csv files. Adds test test_base_prices.test_to_csv and
associated resources files.

Also:

  • includes fixes:
    • to avoid flaky behaviour by Yahoo Finance API when requesting data from around left limit.
    • PricesBase.GetPricesParams.intraday_limit_right now respects session closes.
    • to use PricesCsv with files containing data within one interval of 'now', for example daily data that includes a price for 'today' before today's session (previously would raise error on trying to re-request a live price).
  • updates release workflow
  • updates dependencies

Captures `FutureWarning` raised by `yahooquery` whilst fix
pending merging and release
(dpguthrie/yahooquery#262).
Fixes bug in `PricesYahoo` when requesting data from around
the left limit. Currently behaviour is flaky where will sometimes
return and sometimes not. This fix advances the effective left
limit to the earliest minute for which it appears that behaviour is
consistent, i.e. from where always returns data as expected.

Introduces `limit_intraday_bi` and `limit_intraday_bi_calendar`
methods to `PricesBase`.`limit_intraday_bi` overriden on
`PricesYahoo` to provide for fix.  This also provides for unifying
the intraday limit as defined within `PricesBase.GetPricesParams`
and as defined by `PricesBase.limit_intraday`.

Includes tests for all new methods, including
`PricesYahoo.limit_intraday_bi`.

Also corrects `PricesIntradayUnavailableError` message for when
last available minute is a close.
Preemptively sleeps workflow between publishing and
installing. Also removes `i` counter from while loop (loop was
failing) on incrementing `i`.
Abstracts away verification of a local directory path to valimp.
Adds `to_csv` method to `PricesBase` to provide for exporting
data to .csv files. Adds test `test_base_prices.test_to_csv` and
associated resources files.

Also fixes `PricesBase.GetPricesParams.intraday_limit_right` to
respect session closes.

Also fixes PricesCsv:
* to prevent attempts to request data when using .csv files
containing data within one interval of 'now', for example daily
data that includes a price for 'today' before today's session
closes. In support of this fix:
  * adds 'source_live' parameter to `data.Data` and analagous
SOURCE_LIVE class parameter to `PricesBase`.
  * adds `test_csv.test_not_live` to verify behaviour.
* to not try to get tables for unaligned intervals.
@maread99 maread99 added enhancement New feature or request CI Continuous Integration dependencies Pull requests that update a dependency file Fix Bug fix labels Feb 15, 2024
@maread99 maread99 force-pushed the to-csv branch 3 times, most recently from c119781 to 770a9a2 Compare February 15, 2024 18:48
Fixes for new `test_to_csv` and `test_request_from_left_limit` to
prevent flaky behavior.
@maread99 maread99 merged commit 207d855 into master Feb 15, 2024
7 checks passed
@maread99 maread99 deleted the to-csv branch February 15, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration dependencies Pull requests that update a dependency file enhancement New feature or request Fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant