selik / xport

Python reader and writer for SAS XPORT data transport files.
MIT License
49 stars 24 forks source link

Fix NotImplementedError for pandas>=1.1 #64

Closed dcroote closed 3 years ago

dcroote commented 3 years ago

Fixes #57.

The solution actually comes from the pandas Series class itself and is valid because the Variable class containing the offending constructor subclasses pd.Series:

https://github.com/selik/xport/blob/6f06128e05f83aea546bde708f69ed83fc6c78cc/src/xport/__init__.py#L244

https://github.com/selik/xport/blob/6f06128e05f83aea546bde708f69ed83fc6c78cc/src/xport/__init__.py#L333-L340

I tested it on the dataset I mentioned with pandas 1.0.5, 1.1.0 and 1.2.4 and was able to generate equivalent csv files. This fix also didn't break any of the tests that pass with 1.0.5 in #63.

selik commented 3 years ago

Good find. Want to add yourself to the contributors list in the README?

selik commented 3 years ago

@dcroote Would you like to bump the micro version and push the build to PyPI? I can add you as a maintainer.

dcroote commented 3 years ago

Thanks @selik! I'll open a separate PR to add myself for "minor revisions". If it's alright though, I'll leave control of versioning and PyPI to you.