Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
#539 local ds, unsupported type - json serialization issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof (Chris) Bernat authored and kbernat committed Mar 6, 2018
1 parent 940d5b9 commit fbb7f23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cate/ds/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def _init_data_sources(self, skip_broken: bool = True):
self._data_sources.append(data_source)
except DataAccessError as e:
if skip_broken:
warnings.warn(e.cause, DataAccessWarning, stacklevel=0)
warnings.warn(str(e), DataAccessWarning, stacklevel=0)
else:
raise e

Expand Down Expand Up @@ -782,6 +782,6 @@ def _load_json_file(json_path: str):
def _json_default_serializer(obj):
if isinstance(obj, datetime):
return obj.replace(microsecond=0).isoformat()
# if isinstance(obj, Polygon):
# return str(obj.bounds).replace(' ', '').replace('(', '\"').replace(')', '\"'))
raise TypeError('Not sure how to serialize %s' % (obj,))
else:
warnings.warn('Not sure how to serialize %s %s' % (obj, type(obj)))
return str(obj)

0 comments on commit fbb7f23

Please sign in to comment.