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-1491518: Deploy does not handle schema names that begin with a number #1234

Closed
jhollowell opened this issue Jun 19, 2024 · 1 comment · Fixed by #1310
Closed

SNOW-1491518: Deploy does not handle schema names that begin with a number #1234

jhollowell opened this issue Jun 19, 2024 · 1 comment · Fixed by #1310
Labels
bug Something isn't working

Comments

@jhollowell
Copy link

jhollowell commented Jun 19, 2024

SnowCLI version

2.4.1

Python version

3.11.9

Platform

macOS-13.6.6-arm64-arm-64bit

What happened

I have a valid Snowflake schema called 3_DAYS. (I know this is probably not best practice, but it's what is currently in our production system at the moment). When I attempt to deploy a snowpark app to the schema, it fails because the SQL being executed does not wrap the schema name in quotations.

Console output

> snow snowpark deploy

An unexpected exception occurred. Use --debug option to see the traceback. Exception message:

001003 (42000): 01b51efd-0002-538c-0000-33558f3d4982: SQL compilation error:
syntax error line 1 at position 31 unexpected '.3'.
syntax error line 1 at position 31 unexpected '.3'.
syntax error line 1 at position 38 unexpected '.'.
syntax error line 1 at position 58 unexpected 'comment'.

How to reproduce

  1. Configured my config.toml as follows:
default_connection_name = "dev"

[connections]
[connections.dev]
account = "XXX"
user = "XXX"
role = "XXX"
authenticator = "externalbrowser"
warehouse = "XXX"
database = "TEMP"
schema = "3_DAYS"
  1. Ran snow snowpark init and configured snowflake.yml as follows:
definition_version: 1
snowpark:
  project_name: "my_project"
  stage_name: 'my_deployment'
  src: "app/"

  procedures:
    - name: hello_procedure
      handler: "procedures.hello_procedure"
      signature:
        - name: "name"
          type: "string"
      returns: string
    - name: test_procedure
      handler: "procedures.test_procedure"
      signature: ""
      returns: string
  1. Built the project with snow snowpark build
  2. Attempted to deploy the sample project to the TEMP."3_DAYS" schema with snow snowpark deploy. The CLI failed with the console output attached in the form and the below query is what failed
create stage if not exists TEMP.3_DAYS.my_deployment comment='deployments managed by Snowflake CLI'
@github-actions github-actions bot changed the title Deploy does not handle schema names that begin with a number SNOW-1491518: Deploy does not handle schema names that begin with a number Jun 19, 2024
@sfc-gh-pczajka sfc-gh-pczajka added the bug Something isn't working label Jun 20, 2024
@sfc-gh-turbaszek
Copy link
Collaborator

sfc-gh-turbaszek commented Jun 25, 2024

The solution maybe to use `schema = '"3_DAYS"' to specify it as quoted identifier. Quoted identifiers are bit tricky in cli context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants