long2ice / asynch

An asyncio ClickHouse Python Driver with native (TCP) interface support.
https://github.com/long2ice/asynch
Apache License 2.0
185 stars 43 forks source link

`None` input to a `String` field raise an `TypeError` #80

Open samuelcolvin opened 1 year ago

samuelcolvin commented 1 year ago

Error is:

   await self.write_items(prepared)
  File "/usr/local/lib/python3.11/site-packages/asynch/proto/columns/stringcolumn.py", line 13, in write_items
    await self.writer.write_strings(items)
  File "/usr/local/lib/python3.11/site-packages/asynch/proto/streams/buffered.py", line 49, in write_strings
    await self.write_varint(len(packet))
                            ^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
Wally110 commented 1 year ago

I encountered the same issue.

long2ice commented 1 year ago

Use Nullable(String) instead of String

stankudrow commented 1 month ago

@samuelcolvin , hello. Could you close this issue if it is not actual any more?

stankudrow commented 3 weeks ago

@samuelcolvin