man-group / arctic

High performance datastore for time series and tick data
https://arctic.readthedocs.io/en/latest/
GNU Lesser General Public License v2.1
3.05k stars 583 forks source link

Additional fix for missing pandas.Panel #887

Open enricodetoma opened 3 years ago

enricodetoma commented 3 years ago

I made an additional fix to manage the case of missing Panel in new pandas versions. In fact I discovered that in few cases (e.g. library.delete(symbol)), PandasPanelStore static method can_write_type was still called. With this commit, PandasPanelStore is not even registered as storage class if Panel is missing from pandas.

shashank88 commented 3 years ago

@enricodetoma you need to rebase off the latest master after pinning pandas and numpy

enricodetoma commented 3 years ago

@shashank88 I rebased off the latest master, but I'm not sure what you mean about pinning pandas and numpy. This pull request completes my previous pull request #881 which was meant to allow to use Arctic with recent pandas versions, though without Panel support (but then without the need to pin it to a specific version, I guess).

enricodetoma commented 3 years ago

Actually I'm already using Arctic successfully with pandas 1.2.3 with this change, without Panel support

crazy25000 commented 3 years ago

Actually I'm already using Arctic successfully with pandas 1.2.3 with this change, without Panel support

Same here, using it with latest Pandas. I don't use panels explicitly, just using tick store. Chunk store too slow to use.

samuelrohr commented 2 years ago

Any update on this review?

enricodetoma commented 1 year ago

Hi Duncan, I'm simply skipping importing Panel if it doesn't exist:

try:
    from pandas import Panel
    register_versioned_storage(PandasPanelStore)
except ImportError:
    pass