snowflakedb / snowflake-sqlalchemy

Snowflake SQLAlchemy
https://pypi.python.org/pypi/snowflake-sqlalchemy/
Apache License 2.0
233 stars 152 forks source link

fire_sequence ExecutionContext.isinsert = True, expecting it to be false #152

Closed bouke-nederstigt closed 1 year ago

bouke-nederstigt commented 4 years ago

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using (python --version)?

Python 3.7.5

  1. What operating system and processor architecture are you using (python -c 'import platform; print(platform.platform())')?

Linux-4.19.76-linuxkit-x86_64-with-debian-9.11

  1. What are the component versions in the environment (pip list)? alembic 1.3.3
    aniso8601 8.0.0
    asn1crypto 1.3.0
    attrs 19.3.0
    azure-common 1.1.24
    azure-storage-blob 2.1.0
    azure-storage-common 2.1.0
    bcrypt 3.1.7
    boto3 1.11.9
    botocore 1.14.9
    CacheControl 0.12.6
    cachy 0.3.0
    certifi 2019.11.28 cffi 1.13.2
    chardet 3.0.4
    cleo 0.7.6
    Click 7.0
    clikit 0.4.1
    coverage 5.0.3
    cryptography 2.8
    docutils 0.15.2
    Flask 1.1.1
    Flask-Bcrypt 0.7.1
    Flask-Caching 1.8.0
    Flask-Cors 3.0.8
    Flask-DotEnv 0.1.2
    Flask-Migrate 2.5.2
    flask-restplus 0.13.0
    Flask-Script 2.0.6
    Flask-SQLAlchemy 2.4.1
    Flask-Testing 0.7.1
    gunicorn 20.0.4
    html5lib 1.0.1
    idna 2.8
    ijson 2.6.1
    importlib-metadata 1.5.0
    itsdangerous 1.1.0
    jeepney 0.4.2
    Jinja2 2.11.1
    jmespath 0.9.4
    jsonschema 3.2.0
    keyring 19.3.0
    lockfile 0.12.2
    Mako 1.1.1
    MarkupSafe 1.1.1
    mockito 1.2.0
    more-itertools 8.2.0
    msgpack 0.6.2
    nose 1.3.7
    numpy 1.18.1
    oscrypto 1.2.0
    packaging 20.1
    pandas 0.25.3
    pastel 0.1.1
    pexpect 4.8.0
    pip 19.3.1
    pkginfo 1.5.0.1
    pluggy 0.13.1
    poetry 1.0.0
    ptyprocess 0.6.0
    py 1.8.1
    pycparser 2.19
    pycryptodomex 3.9.6
    pydevd-pycharm 201.3803.74 PyJWT 1.7.1
    pylev 1.3.0
    pylibmc 1.6.1
    pyOpenSSL 19.1.0
    pyparsing 2.4.6
    pyrsistent 0.15.7
    pytest 5.3.5
    pytest-flask 0.15.0
    pytest-mock 1.13.0
    python-dateutil 2.8.1
    python-dotenv 0.10.5
    python-editor 1.0.4
    pytz 2019.3
    requests 2.22.0
    requests-toolbelt 0.8.0
    s3transfer 0.3.2
    SecretStorage 3.1.2
    setuptools 41.0.1
    shellingham 1.3.1
    six 1.14.0
    snowflake-connector-python 2.2.0
    snowflake-sqlalchemy 1.2.0
    SQLAlchemy 1.3.13
    SQLAlchemy-Continuum 1.3.9
    sqlalchemy-mptt 0.2.5
    SQLAlchemy-Utils 0.36.1
    tomlkit 0.5.8
    urllib3 1.25.8
    wcwidth 0.1.8
    webencodings 0.5.1
    Werkzeug 0.16.1
    wheel 0.33.6
    zipp 2.1.0

  2. What did you do? If possible, provide a recipe for reproducing the error. A complete runnable program is good.

Using sqlalchemy continuum for object versioning (https://github.com/kvesteri/sqlalchemy-continuum). The application is listening for update and delete operations. Somewhere in my application a sequence is executed using fire_sequence and context.isinsert returns true for this query. This causes the other library to misbehave. Not completely sure but I wouldn't expect the isinsert to be True for a select statement.

  1. What did you expect to see? SnowflakeExecutionContext.isinsert should probably return false for fire_sequence method

  2. What did you see instead? SnowflakeExecutionContext.isinsert is True

bouke-nederstigt commented 4 years ago

Do you have any ideas if/when this will be fixed? I don't mind submitting a PR myself, but I'm not completely sure if this is expected behaviour or not.

github-actions[bot] commented 1 year ago

To clean up and re-prioritize bugs and feature requests we are closing all issues older than 6 months as of Apr 1, 2023. If there are any issues or feature requests that you would like us to address, please re-create them. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response