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-1726409: Invalid/templated snowflake.yml file makes it impossible to run snow sql #1673

Open
sfc-gh-rzukowski opened this issue Oct 7, 2024 · 0 comments
Labels

Comments

@sfc-gh-rzukowski
Copy link

sfc-gh-rzukowski commented Oct 7, 2024

SnowCLI version

2.8.0

Python version

3.9.18

Platform

macOS-14.6.1-arm64-arm-64bit

What happened

When snowflake.yml cannot be parsed because of an error or env variable not set,
it is not possible to run snow sql because snowflake.yml must be read at the beginning.

This may not be a bug, but rather a design decision. I would expect that snow sql command is independent from a current project and it should not be using local files impllicitly to run, while snow app is the command that could use local project files.

If this is expected behaviour, I would suggest to give more descriptive error message saying explicitly that snowflake.yml cannot be read.

It is also worth considering an option to run sql query without touching files in local directory like snowflake.yml project file. The question is what the default should be.

Console output

% snow --config-file="./deployment/config.toml" sql -q "select 1"  --connection cd
╭─ Error ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Could not find template variable ctx.env.PACKAGE_NAME                                                                                                                                                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

How to reproduce

Include some template code in snowflake.yml file that requires variable to be set, for example

definition_version: 1.1
native_app:
  name: EXAPLE_APP
  source_stage: src.stage
  package:
    name: <% ctx.env.PACKAGE_NAME %>

and try to run simple query while snowflake.yml is in a current directory.

@github-actions github-actions bot changed the title Invalid snowflake.yml file makes it impossible to run snow app sql SNOW-1726409: Invalid snowflake.yml file makes it impossible to run snow app sql Oct 7, 2024
@sfc-gh-rzukowski sfc-gh-rzukowski changed the title SNOW-1726409: Invalid snowflake.yml file makes it impossible to run snow app sql SNOW-1726409: Invalid snowflake.yml file makes it impossible to run snow sql Oct 7, 2024
@sfc-gh-rzukowski sfc-gh-rzukowski changed the title SNOW-1726409: Invalid snowflake.yml file makes it impossible to run snow sql SNOW-1726409: Invalid/templated snowflake.yml file makes it impossible to run snow sql Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants