diff --git a/omniduct/caches/base.py b/omniduct/caches/base.py index d3b5278..8c96e6b 100644 --- a/omniduct/caches/base.py +++ b/omniduct/caches/base.py @@ -48,6 +48,10 @@ def wrapped(method, self, *args, **kwargs): if _renew or not _cache.has_key(_key, namespace=_namespace): # noqa: has_key is not of a dictionary here value = method(self, **kwargs) + if value is None: + logger.warning("Method value returned None. Not saving to cache.") + return + try: _cache.set( _key, diff --git a/omniduct/databases/base.py b/omniduct/databases/base.py index f247656..773b665 100644 --- a/omniduct/databases/base.py +++ b/omniduct/databases/base.py @@ -613,7 +613,7 @@ def _dataframe_to_table(self, df, table, if_exists='fail', **kwargs): raise NotImplementedError def _cursor_empty(self, cursor): - return False + return cursor is None def _parse_namespaces(self, name, level=0, defaults=None): return ParsedNamespaces.from_name( diff --git a/omniduct/databases/sqlalchemy.py b/omniduct/databases/sqlalchemy.py index 16d5bc2..a2006cc 100644 --- a/omniduct/databases/sqlalchemy.py +++ b/omniduct/databases/sqlalchemy.py @@ -86,9 +86,6 @@ def _dataframe_to_table(self, df, table, if_exists='fail', **kwargs): return df.to_sql(name=table.table, schema=table.database, con=self.engine, index=False, if_exists=if_exists, **kwargs) - def _cursor_empty(self, cursor): - return False - def _table_list(self, **kwargs): return self.query("SHOW TABLES", **kwargs)