I see. Thank you. I am still a bit unsure about what the second value in the tuple represents. Are these indeed the nanoseconds? Apparently a Python datetime can have differing precisions (perhaps depending on platform)...
Kind regards, Stéphane Thibaud 2019年5月16日(木) 0:10 Igor Sapego <[email protected]>: > I believe, it's OK to pass tuple for timestamp in python, but you also > should > add a tip for the client to inform it you are going to store timestamp > value. > > Take a look at tests for example: [1] > > 1 - > https://github.com/apache/ignite/blob/master/modules/platforms/python/tests/test_datatypes.py#L80 > > Best Regards, > Igor > > > On Wed, May 15, 2019 at 12:24 PM Stéphane Thibaud <[email protected]> > wrote: > >> Thank you. I will try to create a code line to reproduce it, but I >> remember the following: when you do a 'select' query on a timestamp column >> with the Python thin client, you get a tuple. Because of that, I assumed >> that a tuple also had to be written in an update query. >> >> >> Kind regards, >> >> Stéphane Thibaud >> >> 2019年5月15日(水) 17:59 Igor Sapego <[email protected]>: >> >>> Stéphane, >>> >>> Can you sharer a code line, how do you try to store timestamp value? >>> >>> Best Regards, >>> Igor >>> >>> >>> On Tue, May 14, 2019 at 7:23 PM Denis Mekhanikov <[email protected]> >>> wrote: >>> >>>> Stéphane, >>>> >>>> Could you provide the code, that results in this exception? >>>> Do you try to insert the tuple as a single field via SQL? There is no >>>> such primitive as a tuple in SQL, so you should probably split timestamp >>>> into datetime and nanoseconds columns and store them separately as two >>>> different columns. >>>> >>>> Denis >>>> >>>> сб, 4 мая 2019 г. в 10:39, Stéphane Thibaud <[email protected]>: >>>> >>>>> Hello Apache users, >>>>> >>>>> I am running into the following issue: when I try to store a timestamp >>>>> with nanosecond precision with the Python Thin client, I get the stack >>>>> trace below. I have specified the timestamp as a tuple of (datetime, >>>>> nanoseconds) as that is the format in which I also get timestamps back >>>>> from >>>>> the apache ignite client. Strangely, I can set just a datetime, but then >>>>> the nanoseconds become zero. Am I doing it in the wrong way? Any >>>>> suggestions? >>>>> >>>>> >>>>> >>>>> db.sql(query, query_args=[converted_row[c] for c in >>>>> table.column_names]) >>>>> File >>>>> "/home/snthibaud/PycharmProjects/tabee/venv/lib/python3.7/site-packages/pyignite/client.py", >>>>> line 401, in sql >>>>> max_rows, timeout, >>>>> File >>>>> "/home/snthibaud/PycharmProjects/tabee/venv/lib/python3.7/site-packages/pyignite/api/sql.py", >>>>> line 370, in sql_fields >>>>> 'include_field_names': include_field_names, >>>>> File >>>>> "/home/snthibaud/PycharmProjects/tabee/venv/lib/python3.7/site-packages/pyignite/queries/__init__.py", >>>>> line 260, in from_python >>>>> buffer += c_type.from_python(values[name]) >>>>> File >>>>> "/home/snthibaud/PycharmProjects/tabee/venv/lib/python3.7/site-packages/pyignite/datatypes/internal.py", >>>>> line 471, in from_python >>>>> buffer += infer_from_python(x) >>>>> File >>>>> "/home/snthibaud/PycharmProjects/tabee/venv/lib/python3.7/site-packages/pyignite/datatypes/internal.py", >>>>> line 399, in infer_from_python >>>>> if is_hinted(value): >>>>> File >>>>> "/home/snthibaud/PycharmProjects/tabee/venv/lib/python3.7/site-packages/pyignite/utils.py", >>>>> line 51, in is_hinted >>>>> and issubclass(value[1], IgniteDataType) >>>>> File "/usr/lib/python3.7/abc.py", line 143, in __subclasscheck__ >>>>> return _abc_subclasscheck(cls, subclass) >>>>> TypeError: issubclass() arg 1 must be a class >>>>> >>>>> Kind regards, >>>>> >>>>> Stéphane Thibaud >>>>> >>>>> >>>>>
