def _json_serializer(self, obj):
        if isinstance(obj, datetime.datetime) or isinstance(obj, datetime.date):
            return obj.isoformat()
        raise TypeError('Type not serializable')
format the object which json not supported
dataset/ETHPy150Open zhongbiaodev/py-mysql-elasticsearch-sync/es_sync/__init__.py/ElasticSync._json_serializer