question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SNOW-638842: "WHERE xxx IN :param" does not work as expected

See original GitHub issue
  1. What version of Python are you using? 3.8.13

  2. What operating system and processor architecture are you using? macOS-12.4-x86_64-i386-64bit

  3. What are the component versions in the environment (pip freeze)? snowflake-sqlalchemy==1.2.4 sqlalchemy==1.3.23

  4. What did you do?

schemas = ('a', 'b') # same issue when schemas is a list
query = """
    SELECT schema_name
    FROM information_schema.schemata AS s
    WHERE s.schema_name IN :schemas
"""
results = conn.execute(sqlalchemy.sql.text(query), schemas=schemas)

Expected

SELECT schema_name
FROM information_schema.schemata AS s
WHERE s.schema_name IN ('a','b')

Actual

SELECT schema_name
FROM information_schema.schemata AS s
WHERE s.schema_name IN 'a','b'

There is a workaround which is to add the parens in the query string e.g

WHERE s.schema_name IN (:schemas)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
sfc-gh-alingcommented, Nov 11, 2022

@shusson , apologize for the late response, I was working on some other prioritized stuff. yes, I will check how postgres implements it

0reactions
shussoncommented, Nov 11, 2022

This is still an issue for us @sfc-gh-aling @sfc-gh-mkeller. Can we re-open this ticket?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · snowflakedb/snowflake-sqlalchemy
SNOW-679045: _rfc_1738_quote is no longer available in sqlalc. ... SNOW-638842: "WHERE xxx IN :param" does not work as expected bug needs triage.
Read more >
Parameter value [1] did not match expected type [java.lang. ...
I tried to change Integer to Long or String it helped to fix my problem but in this case my Spring Data Rest...
Read more >
Building a Parameter Table for Power Query
Today I'm going to show you how I solved that problem by building a parameter table for Power Query in Excel, then link...
Read more >
snowflakedb/snowflake-sqlalchemy Issues
SNOW-679045: _rfc_1738_quote is no longer available in sqlalchemy 1.4.42 ... SNOW-638842: "WHERE xxx IN :param" does not work as expected.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found