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

Snowflake destination issue: fail to execute multiple sql queries #1312

Closed
hengpor opened this issue May 3, 2024 · 3 comments
Closed

Snowflake destination issue: fail to execute multiple sql queries #1312

hengpor opened this issue May 3, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@hengpor
Copy link

hengpor commented May 3, 2024

dlt version

0.4.10

Describe the problem

There bug in snowflake destination

curr.execute(query, db_args, num_statements=0)

num_statements=0 is hardcoded into code when query can be more than one sql queries

Expected behavior

num_statements should the number queries

Steps to reproduce

Running pipeline using snowflake-connector-python 2.9.0

Operating system

macOS

Runtime environment

Local

Python version

3.9

dlt data source

No response

dlt destination

Snowflake

Other deployment details

No response

Additional information

No response

@rudolfix
Copy link
Collaborator

rudolfix commented May 3, 2024

@hengpor do you have a stack trace with this bug?

num_statements=0 is a special value for multi-statement query:
https://github.com/snowflakedb/snowflake-connector-python/blob/main/src/snowflake/connector/cursor.py#L901

we have plenty of tests that execute multiple queries, maybe you have problem with a specific snowflake python client version?

@rudolfix rudolfix added the bug Something isn't working label May 3, 2024
@hengpor
Copy link
Author

hengpor commented May 3, 2024

I am using snowflake connector 2.9.0

@rudolfix
Copy link
Collaborator

rudolfix commented May 6, 2024

@hengpor are you able to switch to "3.5.0" or newer? there are quite significant improvements from snowflake side ie. they removed pyarrow as dependency.

2.9.0 is from 2022. if you have hard requirements to use it ping me I'll try to run our tests on it. it is a first version that introduced the support for multi queries and I expect some bugs in it

@rudolfix rudolfix self-assigned this May 6, 2024
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
Status: Done
Development

No branches or pull requests

2 participants