excieve / dragnet

Catching the big fish
MIT License
2 stars 1 forks source link

What the hell? #20

Closed dchaplinsky closed 6 years ago

dchaplinsky commented 6 years ago

Awwfuck:

Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "utils/load.py", line 44, in import_batch
    imported_docs = list(filter(lambda x: x.get('error') is None, db.bulk_docs(docs_objects)))
  File "/var/www/declarations.com.ua/env/lib/python3.5/site-packages/cloudant/database.py", line 683, in bulk_docs
    data=json.dumps(data, cls=self.client.encoder),
  File "/usr/lib/python3.5/json/__init__.py", line 237, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: datetime.datetime(2017, 9, 1, 0, 0) is not JSON serializable
dchaplinsky commented 6 years ago

it does

On Wed, Dec 20, 2017 at 1:38 PM, Artem Hluvchynskyi < notifications@github.com> wrote:

@excieve commented on this pull request.

In utils/nacp_parser.py https://github.com/excieve/dragnet/pull/20#discussion_r158001035:

@@ -297,7 +297,7 @@ def _parse_me(cls, base_fname): resp["declaration"]["basename"] = os.path.basename(base_fname)

     resp["intro"]["corrected"] = id_ in cls.corrected
  • resp["intro"]["date"] = str(cls.parse_date(created_date).year)
  • resp["intro"]["date"] = cls.parse_date(created_date).isoformat()

What I meant is to check if this format works well with this mapping: https://github.com/dchaplinsky/declarations.com. ua/blob/master/declarations_site/catalog/elastic_models.py#L733

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/excieve/dragnet/pull/20#discussion_r158001035, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIAckaiD3fa9EuNUIxBJ18uhpFH-wNkks5tCPGxgaJpZM4RGWGo .