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

Parameterized queries with tuples don't work #3090

Open
matthias-Q opened this issue Feb 6, 2025 · 0 comments
Open

Parameterized queries with tuples don't work #3090

matthias-Q opened this issue Feb 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@matthias-Q
Copy link

Describe the bug

I was trying to use parameters in a query like:

select * from table_name where id_ in (:ids)

using wr.athena.start_query_execution I provided a list of strings
params={"ids":tuple(["1","1000"])}

This fails with the following error message:
IN value and list items must be the same type or coercible to a common type. Cannot find common type between varchar and array(varchar(4)), all types (without duplicates): [varchar, array(varchar(4))]
There seems to be some conversion going on with the second parameter.

Then I tried to use the paramstyle 'qmark'. The query looked like this:

select * from table_name where id_ in (?,?)

and the query failed with this message
IN value and list items must be the same type or coercible to a common type. Cannot find common type between varchar and integer, all types (without duplicates): [varchar, integer]. Both elements of that list are strings!. For some reason it seems to get converted to integer.

How to Reproduce

*P.S. Please do not attach files as it's considered a security risk. Add code snippets directly in the message body as much as possible.*

Expected behavior

Tuple/Lists into a parameter should not be converted.

Your project

No response

Screenshots

No response

OS

Linux

Python version

3.11

AWS SDK for pandas version

awswrangler>=3.11

Additional context

No response

@matthias-Q matthias-Q added the bug Something isn't working label Feb 6, 2025
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

No branches or pull requests

1 participant