Skip to content

Commit

Permalink
trying to fix some serialization issues
Browse files Browse the repository at this point in the history
when using a remote catalog I'm
getting weird errors like KeyError
on 'dtype' and cannot serialize a
Series
  • Loading branch information
AlbertDeFusco committed Oct 25, 2021
1 parent 42114ad commit 4ff6eec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions intake_metabase/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _get_schema(self):
self._df = self._metabase.get_card(self.question)

return Schema(datashape=None,
dtype=self._df.dtypes,
dtype={n: str(t) for (n, t) in self._df.dtypes.items()},
shape=(None, len(self._df.columns)),
npartitions=1,
extra_metadata={})
Expand All @@ -112,7 +112,7 @@ def to_dask(self):
raise NotImplementedError()

def _close(self):
self._dataframe = None
self._df = None


class MetabaseTableSource(DataSource):
Expand Down Expand Up @@ -140,7 +140,7 @@ def _get_schema(self):
self._df = self._metabase.get_table(self.database, self.table, self.query)

return Schema(datashape=None,
dtype=self._df.dtypes,
dtype={n: str(t) for (n, t) in self._df.dtypes.items()},
shape=(None, len(self._df.columns)),
npartitions=1,
extra_metadata={})
Expand All @@ -157,7 +157,7 @@ def to_dask(self):
raise NotImplementedError()

def _close(self):
self._dataframe = None
self._df = None


class MetabaseAPI():
Expand Down

0 comments on commit 4ff6eec

Please sign in to comment.