blaze / odo

Data Migration for the Blaze Project
http://odo.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1k stars 138 forks source link

incompatible with latest pandas #621

Open nateGeorge opened 5 years ago

nateGeorge commented 5 years ago

When importing this using pandas 0.24 versions, this error occurs:

---> 26 import odo
     27 import pytz
     28 from tqdm import tqdm

~/anaconda3/lib/python3.6/site-packages/odo/__init__.py in <module>
     27     from .backends.sas import sas7bdat
     28 with ignoring(ImportError):
---> 29     from .backends.pandas import pd
     30 with ignoring(ImportError):
     31     from .backends.bcolz import bcolz

~/anaconda3/lib/python3.6/site-packages/odo/backends/pandas.py in <module>
    100 
    101 
--> 102 @convert.register((pd.Timestamp, pd.Timedelta), (pd.tslib.NaTType, type(None)))
    103 def convert_null_or_nat_to_nat(n, **kwargs):
    104     return pd.NaT

AttributeError: module 'pandas' has no attribute 'tslib'
kyleabeauchamp commented 5 years ago

I also encountered this.

bartly commented 5 years ago

How to fix it ? Is there a resolution

nateGeorge commented 5 years ago

Seeing as the build and docs are broken and it hasn't been updated in many months...seems like development has stalled.

ryoung29 commented 5 years ago

I found a fix. In odo/backends/pandas.py line 94, change pd.tslib.NaTType to type(pd.NaT). Also, the latest version on github has the fix, but I don't know if it's stable,

timcera commented 5 years ago

PR was accepted and merged some time ago: https://github.com/blaze/odo/pull/546

The problem with odo is that no one is preparing releases with the latest code.

On Sat, Apr 20, 2019 at 4:02 PM RYoung notifications@github.com wrote:

I found a fix. In odo/backends/pandas.py line 94, change pd.tslib.NaTType to type(pd.NaT). Should I make a pull request?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blaze/odo/issues/621#issuecomment-485161314, or mute the thread https://github.com/notifications/unsubscribe-auth/AACIRNRZWVBGLOCE3W2KKYTPRNZGRANCNFSM4GX3IOPA .

ryoung29 commented 5 years ago

@timcera yes, If you install the git version, it's working just fine.

amoux commented 5 years ago

I found a fix. In odo/backends/pandas.py line 94, change pd.tslib.NaTType to type(pd.NaT). Also, the latest version on github has the fix, but I don't know if it's stable,

I was able to import after making the change, thanks!!

odoublewen commented 5 years ago

@cpcloud @llllllllll Are there any maintainers who could make a new release?

fizwit commented 5 years ago

Building Python 3.7.4 with odo-0.5.0

>>> import odo
/app/easybuild/software/Python/3.7.4-foss-2016b-fh1/lib/python3.7/site-packages/odo/backends/pandas.py:94: FutureWarning: pandas.tslib is deprecated and will be removed in a future version.
You can access NaTType as type(pandas.NaT)
  @convert.register((pd.Timestamp, pd.Timedelta), (pd.tslib.NaTType, type(None)))
>>> pandas.__version__
'0.23.4'
songhao8080 commented 5 years ago
In [7]: import odo                                                                                                                                           
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-c46519caf147> in <module>
----> 1 import odo

~/.local/lib/python3.6/site-packages/odo/__init__.py in <module>
     27     from .backends.sas import sas7bdat
     28 with ignoring(ImportError):
---> 29     from .backends.pandas import pd
     30 with ignoring(ImportError):
     31     from .backends.bcolz import bcolz

~/.local/lib/python3.6/site-packages/odo/backends/pandas.py in <module>
     92 
     93 
---> 94 @convert.register((pd.Timestamp, pd.Timedelta), (pd.tslib.NaTType, type(None)))
     95 def convert_null_or_nat_to_nat(n, **kwargs):
     96     return pd.NaT

AttributeError: module 'pandas' has no attribute 'tslib'

In [8]: pandas.__version__                                                                                                                                   
Out[8]: '0.25.1'

In [9]: