bug fix: write to SQL complex objects -> str

This commit is contained in:
Steve Nyemba 2024-02-19 22:10:26 -06:00
parent 68f628ec5a
commit 0d7b40cbd8
1 changed files with 5 additions and 1 deletions

View File

@ -159,6 +159,10 @@ class X12Parser(BasicParser):
_writer = transport.factory.instance(**_store) _writer = transport.factory.instance(**_store)
# if _store['provider'] not in [providers.MONGODB, providers.COUCHDB] : # if _store['provider'] not in [providers.MONGODB, providers.COUCHDB] :
for _document in _documents :
for field in _document :
if type(_document[field]) in [dict,list] :
_document[field] = json.dumps(_document[field],default=str)
_writer.write(_documents,table=TABLE) _writer.write(_documents,table=TABLE)
if getattr(_writer,'close') : if getattr(_writer,'close') :