These are chat archives for frictionlessdata/chat

9th
May 2016
sirex
@sirex
May 09 2016 12:57
I'm working on https://github.com/frictionlessdata/datapackage-py/issues/73#issuecomment-217462360 and I'm not sure what exactly should jsontableschema.Storage.read return? Is this should be just strings, or Python objects, if Python object, should they be json serializable?
Vitor Baptista
@vitorbaptista
May 09 2016 13:00
@roll can answer this better than myself, but jsontableschema-sql returns a generator of tuples (https://github.com/frictionlessdata/jsontableschema-sql-py/blob/master/jsontableschema_sql/storage.py#L200-L221)
roll
@roll
May 09 2016 13:07
Sorry it's not prop linked for now - https://github.com/frictionlessdata/jsontableschema-py/blob/master/jsontableschema/storage.py - interface to imp (sorry from phone)
Also this package readmy has add info
sirex
@sirex
May 09 2016 13:15
My question is more related to types of each item in those tuples. From what I see here: https://github.com/frictionlessdata/jsontableschema-sql-py/blob/master/jsontableschema_sql/storage.py#L221 it returns original data form database, but here https://github.com/frictionlessdata/jsontableschema-sql-py/blob/master/tests/test_storage.py#L93 it expects types converted from model.
So it looks, that tuples should contain Python objects, and then tabulator or something else will take care serializing Python objects to target format.
roll
@roll
May 09 2016 13:50
This situation is not fully sorted because of ongoing work on main jts library. For now python objects are good enough.
After jts fix I suppose we could be able make storage interfacw stricter with requirement to return tuples processed by jsontableschema.model.SchemaModel.cast
sirex
@sirex
May 09 2016 13:52
@roll by default json.dumps does not recognize datetime.datetime and decimal.Decimal types. Is it save to leave these kind of types or should they be converted to strings/floats?
roll
@roll
May 09 2016 14:04
For storage.read python types like datetime are the best
sirex
@sirex
May 09 2016 14:23
@roll what is main jts library?
roll
@roll
May 09 2016 14:23
jsontableschema-py sorry im still away