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

Replace empty list with empty pd.Series #1724

Merged
merged 10 commits into from
Jan 9, 2024

Conversation

mreiche
Copy link
Contributor

@mreiche mreiche commented Oct 12, 2023

Fixes the bug, when you want to perform a pandas operation on an empty list, which is returned when no data is present:

ERROR:yfinance:XXX: No timezone found, symbol may be delisted
ERROR:xxx:'list' object has no attribute 'loc'

This change does 2 things:

  • It returns an static empty pandas series instead of a list
  • It annotates the return type for some functions

@mreiche
Copy link
Contributor Author

mreiche commented Jan 8, 2024

I've updated the description. Please review.

Copy link
Collaborator

@ValueRaider ValueRaider left a comment

Choose a reason for hiding this comment

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

Nit-picky comments, but IMO every code change should be relevant and matter.

yfinance/base.py Outdated Show resolved Hide resolved
requirements.txt Outdated
Comment on lines 3 to 13
requests_cache==1.1.0
requests_ratelimiter==0.4.2
multitasking>=0.0.7
lxml>=4.9.1
appdirs>=1.4.4
pytz>=2022.5
frozendict>=2.3.4
beautifulsoup4>=4.11.1
html5lib>=1.1
peewee>=3.16.2 No newline at end of file
peewee>=3.16.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted the explicit dependencies but kept the newline at the end.

tests/ticker.py Outdated
@@ -798,7 +814,7 @@ def test_info(self):
def suite():
suite = unittest.TestSuite()
suite.addTest(TestTicker('Test ticker'))
suite.addTest(TestTickerEarnings('Test earnings'))
#suite.addTest(TestTickerEarnings('Test earnings'))
Copy link
Collaborator

Choose a reason for hiding this comment

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

why comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I branched from the wrong base I guess. Reverted.

@ValueRaider
Copy link
Collaborator

You might have a better time with Git if you rebase your changes.

@mreiche
Copy link
Contributor Author

mreiche commented Jan 9, 2024

You might have a better time with Git if you rebase your changes.

I don't get what happend acutally. I rebased from master to dev and git messed something up. This is the second branch already. I usually don't use rebase because of these issues.

Anyway, is there something you request a change for?

@ValueRaider
Copy link
Collaborator

I'll merge this time, but in future:

  • reference Network Graph, keep it tidy
  • avoid merging in from both main and dev, it usually creates a mess

@mreiche
Copy link
Contributor Author

mreiche commented Jan 9, 2024

I'll merge this time, but in future:

  • reference Network Graph, keep it tidy
  • avoid merging in from both main and dev, it usually creates a mess

Alright

@ValueRaider ValueRaider merged commit 006e0a1 into ranaroussi:dev Jan 9, 2024
1 check passed
@ValueRaider ValueRaider mentioned this pull request Jan 21, 2024
@ValueRaider ValueRaider changed the title Bugfix/data types 2 Replace empty list with empty pd.Series Jan 21, 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.

None yet

2 participants