-
Notifications
You must be signed in to change notification settings - Fork 92
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
pyarrow.lib.ArrowKeyError: A type extension with name pandas.period already defined #947
Comments
Thanks! Looks like the patching is not correctly reverted in this case for some reason. |
@mrbean-bremen thank you for the quick response. How often do you perform maintenance tasks on this lib? I'm looking for visibility on this issue to understand if I need to look for another solution. I am aware you're probably maintaining this repo on your personal time. |
I try to fix issues as soon as possible, but that depends on the kind of issue, and on other things I have to do. I had some shot at that one last weekend, but didn't get anywhere, and haven't since worked on it. I will see what I can do, but probably not before the weekend. I will let you know if I find something, or if this may take longer. And yes, I'm doing this in my free time. I'm always happy about other contributors, of course... |
The problem has to do with the dynamic patcher, but I didn't find the root cause yet. Switching off the dynamic patcher fixes the example, but depending on your use case, it may be needed (it patches modules loaded dynamically during the test). @pytest.fixture
def fs_no_dyn_patch():
with Patcher(use_dynamic_patch=False) as p:
yield p.fs |
For the record (and visibility...): So I will probably add a specific fix for this module (and the possibility to make similar fixes for other modules). |
- may be needed for modules that cannot cleanly reload - used for pandas.core.arrays.arrow.extension_types, see pytest-dev#947
- may be needed for modules that cannot cleanly reload - used for pandas.core.arrays.arrow.extension_types, see #947
@jbbqqf - should be fixed on the main branch. Can you please test if this works for you? |
Hi @mrbean-bremen . I deeply apologize for asking for feedback and not replying until now. I had my test suite broken and ran out of time to fix it. It is now fixed and I didn't experience the issue described above with the main branch of this repo installed ( Thank you! |
Thank you @jbbqqf - I'm waiting for feedback for another issue, and if nothing comes up, I will make a new release sometime next week (traveling right now). |
FYI: A new release is out. |
As far as I can tell, I cannot use twice
pd.read_parquet
when mocking the filesystem.How To Reproduce
Your environment
python3.11 -m venv venv source venv/bin/activate pip install pandas pytest pyfakefs pyarrow venv/bin/pytest tests/test_pyfakefs.py
This is how I generated the parquet file:
The text was updated successfully, but these errors were encountered: