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

Resolve Pandas FutureWarnings #1766

Merged
merged 2 commits into from
Dec 10, 2023

Conversation

JuliaLWang8
Copy link
Contributor

Fixes #1739 :

  • FutureWarning deprecation warning for pandas resolved by updating fillna and iloc in the reconstruct_intervals_batch function.
  • Added a unit test to tests/ticker.py in TestTickerHistory called test_reconstruct_intervals_batch, also validated against current output.

Changed fillna, iloc, and added test changes
@JuliaLWang8
Copy link
Contributor Author

JuliaLWang8 commented Dec 8, 2023

I also had to manually pip install packages not in requirements.txt for testing: requests_cache, and requests_ratelimiter. Is there a reason those aren't included in the reqs?

@ValueRaider
Copy link
Collaborator

ValueRaider commented Dec 8, 2023

Requests caching and rate-limiting are optional for users, and while required for tests I figure developers are smart enough to install.

Btw the requirement is to avoid tests spamming Yahoo. So not strictly required, but highly recommended.

yfinance/base.py Outdated Show resolved Hide resolved
@bot-unit
Copy link

bot-unit commented Dec 9, 2023

Requests caching and rate-limiting are optional for users, and while required for tests I figure developers are smart enough to install.

Btw the requirement is to avoid tests spamming Yahoo. So not strictly required, but highly recommended.

Maybe we should add this requirements with pip[optional]? docs stockoverflow

@ValueRaider
Copy link
Collaborator

Maybe we should add this requirements with pip[optional]? docs stockoverflow

Fine with me. I propose naming pip install yfinance[nospam]

@JuliaLWang8
Copy link
Contributor Author

JuliaLWang8 commented Dec 10, 2023

Maybe we should add this requirements with pip[optional]? docs stockoverflow

Fine with me. I propose naming pip install yfinance[nospam]

Should we include scipy as an optional req too? I noticed it was also purposely excluded in base.py#L872. If we want it separate, both pandas_datareader and scipy could be under yfinance[optional] or something:

extras_require={
        'nospam': ['requests_cache>=1.1.1', 'requests_ratelimiter>=0.4.2'],
        'optional': ['scipy>=1.10.1', 'pandas_datareader>=0.10.0'],
},

@ValueRaider
Copy link
Collaborator

ValueRaider commented Dec 10, 2023

Should we include scipy as an optional req too? I noticed it was also purposely excluded in [base.py#L872]

I don't mind, but if yes then I propose naming yfinance[repair], because only used by price repair.

pandas_datareader

No

ValueRaider
ValueRaider previously approved these changes Dec 10, 2023
@ValueRaider ValueRaider dismissed their stale review December 10, 2023 11:51

Wait for this optional dependencies discussion to resolve.

@ValueRaider ValueRaider self-requested a review December 10, 2023 11:51
@JuliaLWang8
Copy link
Contributor Author

JuliaLWang8 commented Dec 10, 2023

I don't mind, but if yes then I propose naming yfinance[repair], because only used by price repair.

pandas_datareader

No

Sounds good, I can add the discussed extra dependencies to setup.py. Should I make a new PR for that or just do it here?

Also with respect to documentation, does this need to be added somewhere like the readme?

@ValueRaider
Copy link
Collaborator

Create a new PR, reference this for background discussion. Should have done this earlier tbh.

Update README too, maybe move install section to top, and replace requirements with link to file.

@ValueRaider ValueRaider merged commit 5805029 into ranaroussi:dev Dec 10, 2023
1 check passed
@ValueRaider ValueRaider mentioned this pull request Jan 6, 2024
@ValueRaider ValueRaider changed the title Pandas future proofing Resolve Pandas FutureWarnings Jan 6, 2024
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