Skip to content

SNOW-1491104: Inspector get_columns can return columns from other tables. #507

@suhas-dc

Description

@suhas-dc

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    Python 3.11.6

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

    Linux-6.6.31-linuxkit-x86_64-with-glibc2.36

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

asn1crypto==1.5.1
certifi==2024.6.2
cffi==1.16.0
charset-normalizer==3.3.2
cryptography==42.0.8
filelock==3.15.1
idna==3.7
packaging==24.1
platformdirs==4.2.2
pycparser==2.22
PyJWT==2.8.0
pyOpenSSL==24.1.0
pytz==2024.1
requests==2.32.3
snowflake-connector-python==3.11.0
snowflake-sqlalchemy==1.5.3
sortedcontainers==2.4.0
SQLAlchemy==1.4.52
tomlkit==0.12.5
typing_extensions==4.12.2
urllib3==2.2.2
  1. What did you do?

    With two tables whose names only differ in the casing, one all upper case and the other all lower case, for example - SAMPLE_TABLE and sample_table. get_columns('sample_table', ...) will return columns from both the tables.

import sqlalchemy as sa
connect_args={'validate_default_parameters': True}
url = '<snowflake connection string>'
table_name="sample_table"
schema="public"

engine = sa.create_engine(url, connect_args=connect_args)
inspector = inspect(engine)

print([c['name'] for c in inspector.get_columns(table_name, schema=schema)])
  1. What did you expect to see?

    get_columns should only have returned columns from "sample_table" without including columns from "SAMPLE_TABLE".

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

    Unfortunately no, since it would not be easy to sanitize them for the public internet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus-triage_doneInitial triage done, will be further handled by the driver team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions