ydb-sqlalchemy icon indicating copy to clipboard operation
ydb-sqlalchemy copied to clipboard

sqlalchemy.exc.DataError: Unknown name: $series_id_m0"

Open NightStr opened this issue 5 months ago • 1 comments

Issue Description

I tried running example.py:

/home/strix/src/ydb-sqlalchemy/.venv/bin/python /home/strix/src/ydb-sqlalchemy/examples/example.py

However, I encountered the following error:

sqlalchemy.exc.DataError: (ydb_sqlalchemy.dbapi.errors.DataError) position { row: 1 column: 74 } message: "Unknown name: $series_id_m0" end_position { row: 1 column: 74 } severity: 1 (server_code: 400080)
[SQL: INSERT INTO series (series_id, title, series_info, release_date) VALUES (%(series_id_m0)s, %(title_m0)s, %(series_info_m0)s, %(release_date_m0)s), (%(series_id_m1)s, %(title_m1)s, %(series_info_m1)s, %(release_date_m1)s)]
[parameters: {'series_id_m0': 1, 'title_m0': 'IT Crowd', 'series_info_m0': "The IT Crowd is a British sitcom produced by Channel 4, written by Graham Linehan, produced by Ash Atalla and starring Chris O'Dowd, Richard Ayoade, Katherine Parkinson, and Matt Berry.", 'release_date_m0': 13182, 'series_id_m1': 2, 'title_m1': 'Silicon Valley', 'series_info_m1': 'Silicon Valley is an American comedy television series created by Mike Judge, John Altschuler and Dave Krinsky. The series focuses on five young men who founded a startup company in Silicon Valley.', 'release_date_m1': 16166}]
(Background on this error at: https://sqlalche.me/e/20/9h9h)

Process finished with exit code 1

Environment

  • OS: Ubuntu 22.05
  • Python: 3.12

Installed Packages:

Package Version
aiohappyeyeballs 2.4.0
aiohttp 3.10.5
aiosignal 1.3.1
attrs 24.2.0
bcrypt 4.2.0
black 23.3.0
certifi 2024.8.30
cffi 1.17.1
charset-normalizer 3.3.2
click 8.1.7
coverage 7.6.1
cryptography 43.0.1
Cython 0.29.37
docker 6.0.1
flake8 3.9.2
grpcio 1.66.1
idna 3.10
iso8601 2.1.0
paramiko 3.5.0
protobuf 4.25.5
PyNaCl 1.5.0
requests 2.28.2
setuptools 75.1.0
six 1.16.0
SQLAlchemy 2.0.7
websocket-client 0.59.0
ydb 3.11.3
ydb-sqlalchemy 0.0.1b22

It seems there is an issue with the SQL query, especially regarding the variable series_id_m0. The error reports an "Unknown name" for this placeholder. Could you please help in resolving this issue?

Thank you!

NightStr avatar Sep 24 '24 12:09 NightStr