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

not compatible with pandas >= 2.0.3 #315

Closed
randomrandomguy12345 opened this issue Jan 1, 2024 · 11 comments
Closed

not compatible with pandas >= 2.0.3 #315

randomrandomguy12345 opened this issue Jan 1, 2024 · 11 comments

Comments

@randomrandomguy12345
Copy link

I had hard time finding the list of pandas versions that are compatible with the package.

Anyway, the package isn't compatible with pandas 2. This is a problem, as pandas 2 did a few changes here and there, and this breaks the code. Downgrading pandas creates a lot of trouble with big projects. Is there a prospect that in near future the package will be compatible with the newer versions of pandas?

@rsheftel
Copy link
Owner

rsheftel commented Jan 1, 2024

Making it pandas 2.0 compatible is the next item on the task list. For now the latest PyPi release has pandas < 2.0 as a requirement

@randomrandomguy12345
Copy link
Author

Thanks!

@LongSimple
Copy link

Thank you

@programmingwithalex
Copy link

programmingwithalex commented Jan 17, 2024

@rsheftel is there any update on when the update will be deployed? I'll attempt to fork the repo and make a pull request if there's been no progress yet.

@nathanramoscfa
Copy link

I forked the project, made this change to allow pandas greater than 2.0:

nathanramoscfa@0c15491

I saw that there were some commits to this project to support pandas 2.1.x so I am trusting that when I install this forked version of the project, it'll work with pandas>=2.0. Well, I installed this forked version to my environment, and reran my Python application, and it worked with no problems. For reference, the pandas compatibility issue came up for me when I tried to build the docs for my application on ReadTheDocs, which would fail, because of this issue.

@krazykoder
Copy link

krazykoder commented Jan 18, 2024

@nathanramoscfa - I am a noob. Appreciate any input.
Can you write a few lines of instruction on how to build the wheel and install with pip after I git clone your fork. I am having the same issue - some of my code required pandas >2.0.

@nathanramoscfa
Copy link

nathanramoscfa commented Jan 18, 2024

@nathanramoscfa - I am a noob. Appreciate any input.

Can you write a few lines of instruction on how to build the wheel and install with pip after I git clone your fork. I am having the same issue - some of my code required pandas >2.0.

Starting in command prompt, activate your Python environment. I like to use anaconda, so for me it's like this (replace environment name with the actual name of your environment without the <>):

conda activate <environment name>

Navigate to your folder where you store all your Python projects, could be something like this:

cd C:/Python Projects/

Clone my forked version there:

git clone https://github.com/nathanramoscfa/pandas_market_calendars.git

Then navigate to the project's root directory:

cd pandas_market_calendars

Then install as a package to your environment.

pip install .

It should then install the cloned forked project to your Python environment and now when you import pandas_market_calendars into your application, it'll be using my forked version.

Whenever the pandas_market_calendars project updates the PyPi package with the changes we're discussing here, you would then use this command to upgrade the pandas_market_calendars back to the official pip installed version.

pip install --upgrade pandas_market_calendars

I just simply needed a solution now, couldn't wait for the devs to update the official PyPi package. But when they do I'll revert back to that version instead of my forked version.

@rundef
Copy link
Contributor

rundef commented Jan 22, 2024

FWIW I'm using a slightly older version (4.3.1) with pandas 2.1 and haven't encountered any issue

@rsheftel
Copy link
Owner

Thanks. This is going to require some investigation as this library uses a lot of the deep internals of pandas to work and much of the pandas holiday functionality is undocumented.

@kentonself
Copy link
Contributor

Hi.

I am running pandas_market_calendars 4.3.3 with pandas 2.2.0. Everything runs fine, except, I get the following message when I call

get_calendar("NYSE").open_at_Time(schedule=x, timestamp=y)`

FutureWarning: Downcasting behavior in replace is deprecated and will be removed in a future version. To retain the old behavior, explicitly call result.infer_objects(copy=False). To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)

I am assuming this is related to this issue/project.

@rsheftel
Copy link
Owner

v.4.4.0 is published to PyPi and works with Python 3.12 and Pandas 2.2.0

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

No branches or pull requests

8 participants