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-919862: Cannot fetch the table metadata if the schema name contains dot #448

Closed
popcornylu opened this issue Sep 21, 2023 · 2 comments
Assignees
Labels
question Issue is a usage/other question rather than a bug status-triage_done Initial triage done, will be further handled by the driver team

Comments

@popcornylu
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    3.9.7

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

    macOS-13.2.1-arm64-arm-64bit

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

agate==1.7.0
anyio==3.7.0
appnope==0.1.3
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asn1crypto==1.5.1
asttokens==2.2.1
async-lru==2.0.2
attrs==23.1.0
Babel==2.12.1
backcall==0.2.0
beautifulsoup4==4.12.2
bleach==6.0.0
blessed==1.20.0
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
comm==0.1.3
cryptography==40.0.2
dbt-core==1.5.1
dbt-extractor==0.4.1
dbt-snowflake==1.5.1
debugpy==1.6.7
decorator==5.1.1
deepmerge==1.1.0
defusedxml==0.7.1
exceptiongroup==1.1.1
executing==1.2.0
fastjsonschema==2.17.1
filelock==3.12.0
fqdn==1.5.1
future==0.18.3
hologram==0.0.16
idna==3.4
importlib-metadata==6.6.0
inquirer==3.1.3
ipykernel==6.23.1
ipython==8.14.0
isodate==0.6.1
isoduration==20.11.0
jaraco.classes==3.2.3
jedi==0.18.2
Jinja2==3.1.2
json5==0.9.14
jsonpointer==2.3
jsonschema==4.17.3
jupyter-events==0.6.3
jupyter-lsp==2.2.0
jupyter_client==8.2.0
jupyter_core==5.3.0
jupyter_server==2.6.0
jupyter_server_terminals==0.4.4
jupyterlab==4.0.1
jupyterlab-pygments==0.2.2
jupyterlab_server==2.22.1
keyring==23.13.1
leather==0.3.4
Logbook==1.5.3
markdown-it-py==2.2.0
MarkupSafe==2.1.3
mashumaro==3.6
matplotlib-inline==0.1.6
mdurl==0.1.2
minimal-snowplow-tracker==0.0.2
mistune==2.0.5
more-itertools==9.1.0
msgpack==1.0.5
nbclient==0.8.0
nbconvert==7.4.0
nbformat==5.9.0
nest-asyncio==1.5.6
networkx==2.8.8
notebook_shim==0.2.3
oscrypto==1.3.0
overrides==7.3.1
packaging==23.1
pandocfilters==1.5.0
parsedatetime==2.4
parso==0.8.3
pathspec==0.11.1
pexpect==4.8.0
pickleshare==0.7.5
-e git+ssh://[email protected]/InfuseAI/piperider.git@ec458503dd07d02ba7ee4e02a1d68607bd709440#egg=piperider
platformdirs==3.5.1
portalocker==2.7.0
prometheus-client==0.17.0
prompt-toolkit==3.0.38
protobuf==4.23.2
psutil==5.9.5
ptyprocess==0.7.0
pure-eval==0.2.2
pycparser==2.21
pycryptodomex==3.18.0
Pygments==2.15.1
PyJWT==2.7.0
pyOpenSSL==23.2.0
pyrsistent==0.19.3
python-dateutil==2.8.2
python-editor==1.0.4
python-json-logger==2.0.7
python-slugify==8.0.1
pytimeparse==1.1.8
pytz==2023.3
PyYAML==6.0
pyzmq==25.1.0
readchar==4.0.5
requests==2.31.0
requests-toolbelt==1.0.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.4.1
ruamel.yaml==0.17.31
ruamel.yaml.clib==0.2.7
Send2Trash==1.8.2
sentry-sdk==1.25.0
six==1.16.0
sniffio==1.3.0
snowflake-connector-python==3.0.4
snowflake-sqlalchemy==1.5.0
sortedcontainers==2.4.0
soupsieve==2.4.1
SQLAlchemy==1.4.49
sqlparse==0.4.3
stack-data==0.6.2
terminado==0.17.1
text-unidecode==1.3
tinycss2==1.2.1
tomli==2.0.1
tornado==6.3.2
traitlets==5.9.0
typing_extensions==4.6.3
uri-template==1.2.0
urllib3==1.26.16
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.5.2
Werkzeug==2.3.4
zipp==3.15.0
  1. What did you do?
from sqlalchemy import create_engine, text, Table, MetaData
import urllib.parse

account = ''
user = ''
password = ''
database = '<DB>'
schema = 'MY.SCHEMA'  #  schema with dot
warehouse = '<WH>'

connection_string = f'snowflake://{user}:{password}@{account}/{database}'
if schema:
    connection_string += f'?schema={urllib.parse.quote(schema)}'
if warehouse:
    connection_string += f'&warehouse={warehouse}'


engine = create_engine(connection_string)
with engine.connect() as conn:
    result = conn.execute(text("select 1"))
    for r in result:
        print(r)


Table("PROJECT", MetaData(), autoload_with=engine, schema=schema)

and then i get the. error

Must specify the full search path starting from database for POP
[SQL: SHOW /* sqlalchemy:_get_schema_primary_keys */PRIMARY KEYS IN SCHEMA amplitude."DBT"."POP"]
(Background on this error at: https://sqlalche.me/e/14/f405)
  1. What did you expect to see?

    Run without error

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

log.txt

@popcornylu popcornylu added bug Something isn't working needs triage labels Sep 21, 2023
@github-actions github-actions bot changed the title Cannot fetch the table metadata if the schema name contains dot SNOW-919862: Cannot fetch the table metadata if the schema name contains dot Sep 21, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Mar 13, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage Issue is under initial triage and removed needs triage labels Mar 13, 2024
@sfc-gh-dszmolka
Copy link
Contributor

hi and thanks for raising the issue. I could get past the error using

schema = '"MY.SCHEMA"'  #  schema with dot

could you please check if it works for you too ?

@sfc-gh-dszmolka sfc-gh-dszmolka added status-information_needed Additional information is required from the reporter question Issue is a usage/other question rather than a bug status-triage_done Initial triage done, will be further handled by the driver team and removed bug Something isn't working status-triage Issue is under initial triage labels Mar 13, 2024
@sfc-gh-dszmolka
Copy link
Contributor

I'm going to close this out now but please feel free to comment if you need further help.

@sfc-gh-dszmolka sfc-gh-dszmolka removed the status-information_needed Additional information is required from the reporter label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue is a usage/other question rather than a bug 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