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

Fixes for traider.get_historical_prices, and tests for several data sources. #637

Merged
merged 12 commits into from
Nov 26, 2024

Conversation

brettelliot
Copy link
Collaborator

@brettelliot brettelliot commented Nov 25, 2024

Fixes a bug where I wasn't correctly converting a naive datetime to a tz aware datetime. Also adds a of tests for get_historical_prices. And bumps version of lumiwealth-tradier.

Note

I'm currently writing a description for your pull request. I should be done shortly (<1 minute). Please don't edit the description field until I'm finished, or we may overwrite each other. If I find nothing to write about, I'll delete this message.

The polygon helper now checks for rows with nans and considers them as missing so it can fetch them.
Plus some doc comments
I was converting a tz naive index which was throwing off the dates. localizing is the correct way.
renamed the function to clarify its for display purpose
Also refactored it to separate tests for backtesting data sources vs live datasournces
set_pandas_float_display_precision renamed
fixed comment to describe what its doing
this test simulates what the call to get_yesterday_dividends does
that simulates what the call to get_yesterdays_dividend does
…ests pasa

this is a weird one. i think my code is working and my tests work. But the original tests fail. I kinda think i have to fix the test, but i spent time trying to do that and i admit defeat. so im leaving my code commented out.
@brettelliot brettelliot requested a review from grzesir as a code owner November 25, 2024 20:14
Copy link
Contributor

korbit-ai bot commented Nov 25, 2024

Korbit doesn't automatically review large (500+ lines changed) pull requests such as this one. If you want me to review anyway, use /korbit-review.

# with NANs in cached polygon data, you can try to enable this code and fix the tests.

# # Find any dates with nan values in the df_all DataFrame
# missing_dates += df_all[df_all.isnull().all(axis=1)].index.date.tolist()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this is the line that doesn't work for you. Completely missing dates are not guarenteed to have an all-empty entry in the DataFrame. This commented out section can be fully removed.

@grzesir grzesir merged commit c17a820 into dev Nov 26, 2024
1 check passed
@brettelliot brettelliot deleted the test-get-bars branch December 4, 2024 10:53
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