snowflakedb / snowflake-sqlalchemy

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

SNOW-912318: Typed connection URL query parameters get converted to strings #447

Open saulbein opened 1 year ago

saulbein commented 1 year ago

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    Python 3.8.16 (default, Feb 6 2023, 12:05:53) [GCC 12.2.1 20230111]

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

    Linux-6.1.38-1-MANJARO-x86_64-with-glibc2.34

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

    asn1crypto==1.5.1
    certifi==2023.7.22
    cffi==1.15.1
    charset-normalizer==3.2.0
    cryptography==41.0.3
    filelock==3.12.2
    greenlet==2.0.2
    idna==3.4
    oscrypto==1.3.0
    packaging==23.1
    platformdirs==3.8.1
    pycparser==2.21
    pycryptodomex==3.18.0
    PyJWT==2.8.0
    pyOpenSSL==23.2.0
    pytz==2023.3
    requests==2.31.0
    snowflake-connector-python==3.1.0
    -e git+ssh://git@github.com/snowflakedb/snowflake-sqlalchemy.git@de68d864af14200643b74625db4480db87c92172#egg=snowflake_sqlalchemy
    sortedcontainers==2.4.0
    SQLAlchemy==1.4.49
    tomlkit==0.12.1
    typing_extensions==4.7.1
    urllib3==1.26.16
  4. What did you do?

    Passed a non-string snowflake-connector parameter through the URL query parameters - see #438 for booleans specifically and #439 for the fix for them, though not other types. Parameters like converter_class will still get set incorrectly, causing errors or weird behaviour.

  5. What did you expect to see?

    Parameters passed through the URL class should allow passing all python-connector variables through as they are.

  6. Can you set logging to DEBUG and collect the logs?

    See #438.

sfc-gh-dszmolka commented 7 months ago

hi and thank you for submitting the issue and your contribution in the PR ! if this is the same issue as #438 , it looks to be fixed with https://github.com/snowflakedb/snowflake-sqlalchemy/pull/446

please comment if this is unrelated and still needs to be looked into and i can reopen

saulbein commented 7 months ago

This is specifically about other types rather than just booleans - there are also integers and even functions that can be sent to the driver that wouldn't work with snowflake-sqlalchemy.