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

Import Panel in the method where it is needed to prevent errors #928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions arctic/store/_pandas_ndarray_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
import numpy as np
from bson.binary import Binary
from pandas import DataFrame, Series
try:
from pandas import Panel
except ImportError:
pass

from arctic._util import NP_OBJECT_DTYPE
from arctic.serialization.numpy_records import SeriesSerializer, DataFrameSerializer
Expand Down Expand Up @@ -217,7 +213,11 @@ class PandasPanelStore(PandasDataFrameStore):

@staticmethod
def can_write_type(data):
return isinstance(data, Panel)
try:
from pandas import Panel
return isinstance(data, Panel)
except ImportError:
return False

def can_write(self, version, symbol, data):
if self.can_write_type(data):
Expand Down