asynch icon indicating copy to clipboard operation
asynch copied to clipboard

`Unknown type Date32` when inserting data into a `Date32` field

Open hramezani opened this issue 2 years ago • 1 comments

Getting asynch.errors.UnknownTypeError when inserting data into a Date32 field:

  File "lib/python3.11/site-packages/asynch/proto/columns/__init__.py", line 144, in get_column_by_spec
    raise UnknownTypeError("Unknown type {}".format(e.args[0]))
asynch.errors.UnknownTypeError: Code: 50. Unknown type Date32

Here is a minimal script to reproduce the bug:

import asyncio
from datetime import date

import asynch

async def main():
    pool = await asynch.create_pool(minsize=5)
    async with pool.acquire() as conn:
        async with conn.cursor() as cursor:
            await cursor.execute('CREATE DATABASE IF NOT EXISTS test')
            await cursor.execute('CREATE TABLE if not exists test.test (date Date32) ENGINE = MergeTree order by date')

            await cursor.execute('INSERT INTO test.test (date) VALUES', [{'date': date.today()}])

asyncio.run(main())

hramezani avatar Aug 02 '23 14:08 hramezani

https://github.com/long2ice/asynch/commit/020971fe8641b48c1133f311c8be74330816eedf

3FANG avatar Mar 19 '24 12:03 3FANG