From c426153d36d3816fc822ada114aec715d4ac2c19 Mon Sep 17 00:00:00 2001 From: Tomasz Urbaszek Date: Fri, 10 May 2024 09:10:09 +0200 Subject: [PATCH] Rename --data to --variables in snow sql (#1054) --- RELEASE-NOTES.md | 14 +++++++++++++- src/snowflake/cli/plugins/sql/commands.py | 2 +- tests/__snapshots__/test_help_messages.ambr | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 7c1288a2c9..0ef37ad49a 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -5,7 +5,19 @@ ## Deprecations ## New additions -* `snow sql` command supports now client-side templating of queries. + +## Fixes and improvements + + +# v2.3.0 + +## Backward incompatibility + +## Deprecations + +## New additions +* New `snow sql` functionality: + * `-D/--variable` allows variable substitutions in a SQL input (client-side query templating) * New `snow app deploy` functionality: * Passing files and directories as arguments syncs these only: `snow app deploy some-file some-dir`. * `--recursive` syncs all files and subdirectories recursively. diff --git a/src/snowflake/cli/plugins/sql/commands.py b/src/snowflake/cli/plugins/sql/commands.py index 0310d02e09..d279314a22 100644 --- a/src/snowflake/cli/plugins/sql/commands.py +++ b/src/snowflake/cli/plugins/sql/commands.py @@ -45,7 +45,7 @@ def execute_sql( ), data_override: List[str] = typer.Option( None, - "--data", + "--variable", "-D", help="String in format of key=value. If provided the SQL content will " "be treated as template and rendered using provided data.", diff --git a/tests/__snapshots__/test_help_messages.ambr b/tests/__snapshots__/test_help_messages.ambr index 32fbdece53..ee8a2819c6 100644 --- a/tests/__snapshots__/test_help_messages.ambr +++ b/tests/__snapshots__/test_help_messages.ambr @@ -5083,7 +5083,7 @@ │ --filename -f FILE File to execute. [default: None] │ │ --stdin -i Read the query from standard input. Use it when │ │ piping input to this command. │ - │ --data -D TEXT String in format of key=value. If provided the SQL │ + │ --variable -D TEXT String in format of key=value. If provided the SQL │ │ content will be treated as template and rendered │ │ using provided data. │ │ [default: None] │