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

SNOW-846301: SnowflakeDialect.get_columns gives error for columns absent in ischema_names #421

Closed
mayurinehate opened this issue Jun 22, 2023 · 1 comment
Assignees
Labels
bug Something isn't working status-triage_done Initial triage done, will be further handled by the driver team

Comments

@mayurinehate
Copy link

  1. What version of Python are you using?

    Python 3.10.6

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

    Linux-5.19.0-43-generic-x86_64-with-glibc2.35

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

    snowflake-connector-python==3.0.4
    snowflake-sqlalchemy==1.4.7
  1. What did you do?
from sqlalchemy import create_engine, inspect
engine = create_engine("snowflake://XXXX")
connection = engine.connect()
connection.execute("create table geospatial_table (id INTEGER, g GEOMETRY);")
inspector = inspect(connection)
columns = inspector.get_columns("geospatial_table")
  1. What did you expect to see?

    Expected that program would return column details. Instead, received this error -

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mayuri/.local/lib/python3.10/site-packages/snowflake/sqlalchemy/snowdialect.py", line 680, in get_columns
    schema_columns = self._get_schema_columns(connection, schema, **kw)
  File "<string>", line 2, in _get_schema_columns
  File "/home/mayuri/.local/lib/python3.10/site-packages/sqlalchemy/engine/reflection.py", line 47, in cache
    return fn(self, con, *args, **kw)
  File "/home/mayuri/.local/lib/python3.10/site-packages/snowflake/sqlalchemy/snowdialect.py", line 553, in _get_schema_columns
    type_instance = col_type(**col_type_kw)
TypeError: 'NullType' object is not callable
@mayurinehate mayurinehate added bug Something isn't working needs triage labels Jun 22, 2023
@github-actions github-actions bot changed the title SnowflakeDialect.get_columns gives error for columns absent in ischema_names SNOW-846301: SnowflakeDialect.get_columns gives error for columns absent in ischema_names Jun 22, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Mar 26, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage Issue is under initial triage and removed needs triage labels Mar 26, 2024
@sfc-gh-dszmolka
Copy link
Contributor

hi and thank you for raising this issue with us and adding the reproduction is really appreciated! this seems to be working now

    columns = inspector.get_columns("geospatial_table")
    print(columns)

returns

[{'name': 'id', 'type': _CUSTOM_DECIMAL(precision=38, scale=0), 'nullable': True, 'default': None, 'autoincrement': False, 'comment': None, 'primary_key': False}, {'name': 'g', 'type': GEOMETRY(), 'nullable': True, 'default': None, 'autoincrement': False, 'comment': None, 'primary_key': False}]

closing for now but let us know please in a comment if you need further help with this

@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage labels Mar 26, 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 status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants