Skip to content

SNOW-1944398: INSERT statements broken starting with 1.7.2 #576

@bjmarsh

Description

@bjmarsh

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    Python 3.11.9 (main, Feb 19 2025, 11:08:39) [Clang 16.0.0 (clang-1600.0.26.6)]

  2. What operating system and processor architecture are you using?

    macOS-15.3-arm64-arm-64bit

  3. What are the component versions in the environment (pip freeze)?

    asn1crypto==1.5.1
    certifi==2025.1.31
    cffi==1.17.1
    charset-normalizer==3.4.1
    click==8.1.8
    click-help-colors==0.9.4
    cryptography==44.0.1
    filelock==3.17.0
    idna==3.10
    numpy==2.2.3
    packaging==24.2
    pandas==2.2.3
    platformdirs==4.3.6
    pyarrow==19.0.1
    pycparser==2.22
    PyJWT==2.10.1
    pyOpenSSL==24.3.0
    python-dateutil==2.9.0.post0
    python-slugify==8.0.4
    pytz==2025.1
    requests==2.32.3
    six==1.17.0
    snowflake-connector-python==3.13.2
    snowflake-oauth-connector==2.0.5
    snowflake-sqlalchemy==1.7.2
    sortedcontainers==2.4.0
    SQLAlchemy==2.0.38
    text-unidecode==1.3
    tomlkit==0.13.2
    typing_extensions==4.12.2
    tzdata==2025.1
    urllib3==2.3.0

  4. What did you do?

    Create an empty table in snowflake

create or replace table my_table (a string, b string);

Try inserting a single row into this table using this code

from sqlalchemy.engine import create_engine
from sqlalchemy import text
from snowflake.connector import connect as sf_connect

def get_sf_connector():
    return sf_connect(
        user=...,
        account=...,
        ...
    )

engine = create_engine("snowflake://_", creator=get_sf_connector)

query = "insert into my_table values ('foo', 'bar')"

with engine.connect() as connection:
    result = connection.execute(text(query))
    print(result.mappings().all())
  1. What did you expect to see?

    Result of the above code is [{'number of rows inserted': 1}], supposedly indicating successful insertion. However, doing a select * in the snowflake console shows the table is still empty.

    This happens using 1.7.2 or 1.7.3. If I downgrade snowflake-sqlalchemy to 1.7.1, keeping all other packages in pip freeze the same, then the code successfully inserts a row into the table.

    Same empty result happens if I try to insert or merge using a select on another table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions