Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format_query_value for list of integers/floats broken since 0.7.5 #335

Closed
icemac opened this issue Apr 3, 2024 · 1 comment · Fixed by #336
Closed

format_query_value for list of integers/floats broken since 0.7.5 #335

icemac opened this issue Apr 3, 2024 · 1 comment · Fixed by #336
Labels
bug Something isn't working

Comments

@icemac
Copy link

icemac commented Apr 3, 2024

Steps to reproduce

  1. python3.11 -m venv cl
  2. cd cl
  3. bin/pip install clickhouse_connect
  4. bin/python

Expected behaviour

Return a formatted query value, but raises an exception.
This worked fine until 0.7.4.
I think it got broken by #329

Code example

from clickhouse_connect.driver.query import format_query_value
format_query_value([1, 2, 3.14])

Result:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../python3.11/site-packages/clickhouse_connect/driver/query.py", line 402, in format_query_value
    return f"[{', '.join(format_query_value(x, server_tz) for x in value)}]"
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found

Configuration

Environment

  • clickhouse-connect version: 0.7.6
  • Python version: 3.11
  • Operating system: MacOS Sonoma 14.4.1
@icemac icemac added the bug Something isn't working label Apr 3, 2024
@icemac icemac changed the title format_query_value for list of integers broken since 0.7.5 format_query_value for list of integers/floats broken since 0.7.5 Apr 3, 2024
@icemac
Copy link
Author

icemac commented Apr 4, 2024

Thank you for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant