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

FutureWarning: Downcasting object dtype arrays #103

Open
grtax1gh opened this issue Sep 7, 2024 · 7 comments
Open

FutureWarning: Downcasting object dtype arrays #103

grtax1gh opened this issue Sep 7, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@grtax1gh
Copy link

grtax1gh commented Sep 7, 2024

Hello,

When I was downloading the filings, I received this message.
It seems the warning came from the htmltools.py. Could you advise if there is any potential issue?

/opt/anaconda3/lib/python3.12/site-packages/edgar/htmltools.py:259: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True) chunk_df.Item = chunk_df.Item.ffill()

@dgunning
Copy link
Owner

dgunning commented Sep 7, 2024

Will do a release soon than cleans up warnings like this. Thanks for reporting

@dgunning dgunning added the bug Something isn't working label Sep 7, 2024
@dgunning
Copy link
Owner

dgunning commented Sep 8, 2024

What is your pandas version?

pip show pandas

The problem relates to an error that happened with older versions of pandas that I had to conditionally handle. I will likely have to require a pandas version >= 2.1.0 in a future release

@grtax1gh
Copy link
Author

grtax1gh commented Sep 8, 2024

My pandas version is 2.2.2

@dgunning
Copy link
Owner

I added what I think will be a fix, since I cannot reproduce. Currently I'm preparing a release and it will be included with it .. likely in a couple of days

@grtax1gh
Copy link
Author

Thank you very much. I will check if I still face the similar warning and let you know accordingly.

@dgunning
Copy link
Owner

Is FutureWarning: Downcasting object dtype arrays still an issue?

@grtax1gh
Copy link
Author

Sorry for the late response. I just checked by running the code to get all filings in 2023, and unfortunately, the message is still persisting.
edgar version 5.6.0

/opt/anaconda3/lib/python3.12/site-packages/edgar/htmltools.py:271: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True) chunk_df.Item = chunk_df.Item.ffill().infer_objects(copy=False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants