diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 69a4558f5..1fa1bb11d 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -17,6 +17,7 @@ # Unreleased version ## Backward incompatibility * Dropped support for Python below 3.10 version. +* `snow object stage` commands are removed in favour of `snow stage`. ## Deprecations diff --git a/src/snowflake/cli/app/commands_registration/builtin_plugins.py b/src/snowflake/cli/app/commands_registration/builtin_plugins.py index be38be219..25d6e97a0 100644 --- a/src/snowflake/cli/app/commands_registration/builtin_plugins.py +++ b/src/snowflake/cli/app/commands_registration/builtin_plugins.py @@ -19,11 +19,6 @@ from snowflake.cli.plugins.nativeapp import plugin_spec as nativeapp_plugin_spec from snowflake.cli.plugins.notebook import plugin_spec as notebook_plugin_spec from snowflake.cli.plugins.object import plugin_spec as object_plugin_spec - -# TODO 3.0: remove this import -from snowflake.cli.plugins.object_stage_deprecated import ( - plugin_spec as object_stage_deprecated_plugin_spec, -) from snowflake.cli.plugins.snowpark import plugin_spec as snowpark_plugin_spec from snowflake.cli.plugins.spcs import plugin_spec as spcs_plugin_spec from snowflake.cli.plugins.sql import plugin_spec as sql_plugin_spec @@ -45,7 +40,6 @@ def get_builtin_plugin_name_to_plugin_spec(): "streamlit": streamlit_plugin_spec, "git": git_plugin_spec, "notebook": notebook_plugin_spec, - "object-stage-deprecated": object_stage_deprecated_plugin_spec, "cortex": cortex_plugin_spec, "init": init_plugin_spec, "workspace": workspace_plugin_spec, diff --git a/src/snowflake/cli/plugins/object_stage_deprecated/__init__.py b/src/snowflake/cli/plugins/object_stage_deprecated/__init__.py deleted file mode 100644 index a5df24d02..000000000 --- a/src/snowflake/cli/plugins/object_stage_deprecated/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2024 Snowflake Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO 3.0: remove this file diff --git a/src/snowflake/cli/plugins/object_stage_deprecated/commands.py b/src/snowflake/cli/plugins/object_stage_deprecated/commands.py deleted file mode 100644 index fd1f89b31..000000000 --- a/src/snowflake/cli/plugins/object_stage_deprecated/commands.py +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright (c) 2024 Snowflake Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO 3.0: remove these commands - -from __future__ import annotations - -import typer -from snowflake.cli.api.commands.flags import ( - PatternOption, -) -from snowflake.cli.api.commands.snow_typer import SnowTyperFactory -from snowflake.cli.api.console import cli_console -from snowflake.cli.api.plugins.command import CommandPath -from snowflake.cli.plugins.stage.commands import ( - StageNameArgument, - copy, - stage_create, - stage_diff, - stage_list_files, - stage_remove, -) - -_deprecated_command_msg = ( - f"`{CommandPath(['object', 'stage'])}` command group is deprecated." - f" Please use `{CommandPath(['stage'])}` instead." -) - -app = SnowTyperFactory(name="stage", help="Manages stages.", deprecated=True) - - -@app.callback() -def warn_command_deprecated() -> None: - cli_console.warning(_deprecated_command_msg) - - -@app.command("list", requires_connection=True, deprecated=True) -def deprecated_stage_list( - stage_name: str = StageNameArgument, pattern=PatternOption, **options -): - """ - Lists the stage contents. - """ - return stage_list_files(stage_name=stage_name, pattern=pattern, **options) - - -@app.command("copy", requires_connection=True, deprecated=True) -def deprecated_copy( - source_path: str = typer.Argument( - help="Source path for copy operation. Can be either stage path or local." - ), - destination_path: str = typer.Argument( - help="Target directory path for copy operation. Should be stage if source is local or local if source is stage.", - ), - overwrite: bool = typer.Option( - False, - help="Overwrites existing files in the target path.", - ), - parallel: int = typer.Option( - 4, - help="Number of parallel threads to use when uploading files.", - ), - recursive: bool = typer.Option( - False, - help="Copy files recursively with directory structure.", - ), - **options, -): - """ - Copies all files from target path to target directory. This works for both uploading - to and downloading files from the stage. - """ - copy( - source_path=source_path, - destination_path=destination_path, - overwrite=overwrite, - parallel=parallel, - recursive=recursive, - ) - - -@app.command("create", requires_connection=True, deprecated=True) -def deprecated_stage_create(stage_name: str = StageNameArgument, **options): - """ - Creates a named stage if it does not already exist. - """ - stage_create(stage_name=stage_name, **options) - - -@app.command("remove", requires_connection=True, deprecated=True) -def deprecated_stage_remove( - stage_name: str = StageNameArgument, - file_name: str = typer.Argument(..., help="Name of the file to remove."), - **options, -): - """ - Removes a file from a stage. - """ - stage_remove(stage_name=stage_name, file_name=file_name) - - -@app.command("diff", hidden=True, requires_connection=True, deprecated=True) -def deprecated_stage_diff( - stage_name: str = typer.Argument(None, help="Fully qualified name of a stage"), - folder_name: str = typer.Argument(None, help="Path to local folder"), - **options, -): - """ - Diffs a stage with a local folder. - """ - return stage_diff(stage_name=stage_name, folder_name=folder_name, **options) diff --git a/src/snowflake/cli/plugins/object_stage_deprecated/plugin_spec.py b/src/snowflake/cli/plugins/object_stage_deprecated/plugin_spec.py deleted file mode 100644 index 02c46401d..000000000 --- a/src/snowflake/cli/plugins/object_stage_deprecated/plugin_spec.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2024 Snowflake Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO 3.0: remove this file - -from snowflake.cli.api.plugins.command import ( - CommandPath, - CommandSpec, - CommandType, - plugin_hook_impl, -) -from snowflake.cli.plugins.object_stage_deprecated import commands - - -@plugin_hook_impl -def command_spec(): - return CommandSpec( - parent_command_path=CommandPath(["object"]), - command_type=CommandType.COMMAND_GROUP, - typer_instance=commands.app.create_instance(), - ) diff --git a/tests/__snapshots__/test_help_messages.ambr b/tests/__snapshots__/test_help_messages.ambr index b23a652d6..28d2437ec 100644 --- a/tests/__snapshots__/test_help_messages.ambr +++ b/tests/__snapshots__/test_help_messages.ambr @@ -2791,424 +2791,6 @@ +------------------------------------------------------------------------------+ - ''' -# --- -# name: test_help_messages[object.stage.copy] - ''' - DeprecationWarning: The command 'stage' is deprecated. - `snow object stage` command group is deprecated. Please use `snow stage` instead. - - Usage: default object stage copy [OPTIONS] SOURCE_PATH DESTINATION_PATH - - (deprecated) - Copies all files from target path to target directory. This works for both - uploading to and downloading files from the stage. - - +- Arguments ------------------------------------------------------------------+ - | * source_path TEXT Source path for copy operation. Can be | - | either stage path or local. | - | [default: None] | - | [required] | - | * destination_path TEXT Target directory path for copy operation. | - | Should be stage if source is local or local | - | if source is stage. | - | [default: None] | - | [required] | - +------------------------------------------------------------------------------+ - +- Options --------------------------------------------------------------------+ - | --overwrite --no-overwrite Overwrites existing files in the | - | target path. | - | [default: no-overwrite] | - | --parallel INTEGER Number of parallel threads to | - | use when uploading files. | - | [default: 4] | - | --recursive --no-recursive Copy files recursively with | - | directory structure. | - | [default: no-recursive] | - | --help -h Show this message and exit. | - +------------------------------------------------------------------------------+ - +- Connection configuration ---------------------------------------------------+ - | --connection,--environment -c TEXT Name of the connection, as defined | - | in your `config.toml`. Default: | - | `default`. | - | --account,--accountname TEXT Name assigned to your Snowflake | - | account. Overrides the value | - | specified for the connection. | - | --user,--username TEXT Username to connect to Snowflake. | - | Overrides the value specified for | - | the connection. | - | --password TEXT Snowflake password. Overrides the | - | value specified for the | - | connection. | - | --authenticator TEXT Snowflake authenticator. Overrides | - | the value specified for the | - | connection. | - | --private-key-path TEXT Snowflake private key path. | - | Overrides the value specified for | - | the connection. | - | --token-file-path TEXT Path to file with an OAuth token | - | that should be used when | - | connecting to Snowflake | - | --database,--dbname TEXT Database to use. Overrides the | - | value specified for the | - | connection. | - | --schema,--schemaname TEXT Database schema to use. Overrides | - | the value specified for the | - | connection. | - | --role,--rolename TEXT Role to use. Overrides the value | - | specified for the connection. | - | --warehouse TEXT Warehouse to use. Overrides the | - | value specified for the | - | connection. | - | --temporary-connection -x Uses connection defined with | - | command line parameters, instead | - | of one defined in config | - | --mfa-passcode TEXT Token to use for multi-factor | - | authentication (MFA) | - | --enable-diag Run python connector diagnostic | - | test | - | --diag-log-path TEXT Diagnostic report path | - | --diag-allowlist-path TEXT Diagnostic report path to optional | - | allowlist | - +------------------------------------------------------------------------------+ - +- Global configuration -------------------------------------------------------+ - | --format [TABLE|JSON] Specifies the output format. | - | [default: TABLE] | - | --verbose -v Displays log entries for log levels `info` | - | and higher. | - | --debug Displays log entries for log levels `debug` | - | and higher; debug logs contains additional | - | information. | - | --silent Turns off intermediate output to console. | - +------------------------------------------------------------------------------+ - - - ''' -# --- -# name: test_help_messages[object.stage.create] - ''' - DeprecationWarning: The command 'stage' is deprecated. - `snow object stage` command group is deprecated. Please use `snow stage` instead. - - Usage: default object stage create [OPTIONS] STAGE_NAME - - (deprecated) - Creates a named stage if it does not already exist. - - +- Arguments ------------------------------------------------------------------+ - | * stage_name TEXT Name of the stage. [required] | - +------------------------------------------------------------------------------+ - +- Options --------------------------------------------------------------------+ - | --help -h Show this message and exit. | - +------------------------------------------------------------------------------+ - +- Connection configuration ---------------------------------------------------+ - | --connection,--environment -c TEXT Name of the connection, as defined | - | in your `config.toml`. Default: | - | `default`. | - | --account,--accountname TEXT Name assigned to your Snowflake | - | account. Overrides the value | - | specified for the connection. | - | --user,--username TEXT Username to connect to Snowflake. | - | Overrides the value specified for | - | the connection. | - | --password TEXT Snowflake password. Overrides the | - | value specified for the | - | connection. | - | --authenticator TEXT Snowflake authenticator. Overrides | - | the value specified for the | - | connection. | - | --private-key-path TEXT Snowflake private key path. | - | Overrides the value specified for | - | the connection. | - | --token-file-path TEXT Path to file with an OAuth token | - | that should be used when | - | connecting to Snowflake | - | --database,--dbname TEXT Database to use. Overrides the | - | value specified for the | - | connection. | - | --schema,--schemaname TEXT Database schema to use. Overrides | - | the value specified for the | - | connection. | - | --role,--rolename TEXT Role to use. Overrides the value | - | specified for the connection. | - | --warehouse TEXT Warehouse to use. Overrides the | - | value specified for the | - | connection. | - | --temporary-connection -x Uses connection defined with | - | command line parameters, instead | - | of one defined in config | - | --mfa-passcode TEXT Token to use for multi-factor | - | authentication (MFA) | - | --enable-diag Run python connector diagnostic | - | test | - | --diag-log-path TEXT Diagnostic report path | - | --diag-allowlist-path TEXT Diagnostic report path to optional | - | allowlist | - +------------------------------------------------------------------------------+ - +- Global configuration -------------------------------------------------------+ - | --format [TABLE|JSON] Specifies the output format. | - | [default: TABLE] | - | --verbose -v Displays log entries for log levels `info` | - | and higher. | - | --debug Displays log entries for log levels `debug` | - | and higher; debug logs contains additional | - | information. | - | --silent Turns off intermediate output to console. | - +------------------------------------------------------------------------------+ - - - ''' -# --- -# name: test_help_messages[object.stage.diff] - ''' - DeprecationWarning: The command 'stage' is deprecated. - `snow object stage` command group is deprecated. Please use `snow stage` instead. - - Usage: default object stage diff [OPTIONS] [STAGE_NAME] [FOLDER_NAME] - - (deprecated) - Diffs a stage with a local folder. - - +- Arguments ------------------------------------------------------------------+ - | stage_name [STAGE_NAME] Fully qualified name of a stage | - | [default: None] | - | folder_name [FOLDER_NAME] Path to local folder [default: None] | - +------------------------------------------------------------------------------+ - +- Options --------------------------------------------------------------------+ - | --help -h Show this message and exit. | - +------------------------------------------------------------------------------+ - +- Connection configuration ---------------------------------------------------+ - | --connection,--environment -c TEXT Name of the connection, as defined | - | in your `config.toml`. Default: | - | `default`. | - | --account,--accountname TEXT Name assigned to your Snowflake | - | account. Overrides the value | - | specified for the connection. | - | --user,--username TEXT Username to connect to Snowflake. | - | Overrides the value specified for | - | the connection. | - | --password TEXT Snowflake password. Overrides the | - | value specified for the | - | connection. | - | --authenticator TEXT Snowflake authenticator. Overrides | - | the value specified for the | - | connection. | - | --private-key-path TEXT Snowflake private key path. | - | Overrides the value specified for | - | the connection. | - | --token-file-path TEXT Path to file with an OAuth token | - | that should be used when | - | connecting to Snowflake | - | --database,--dbname TEXT Database to use. Overrides the | - | value specified for the | - | connection. | - | --schema,--schemaname TEXT Database schema to use. Overrides | - | the value specified for the | - | connection. | - | --role,--rolename TEXT Role to use. Overrides the value | - | specified for the connection. | - | --warehouse TEXT Warehouse to use. Overrides the | - | value specified for the | - | connection. | - | --temporary-connection -x Uses connection defined with | - | command line parameters, instead | - | of one defined in config | - | --mfa-passcode TEXT Token to use for multi-factor | - | authentication (MFA) | - | --enable-diag Run python connector diagnostic | - | test | - | --diag-log-path TEXT Diagnostic report path | - | --diag-allowlist-path TEXT Diagnostic report path to optional | - | allowlist | - +------------------------------------------------------------------------------+ - +- Global configuration -------------------------------------------------------+ - | --format [TABLE|JSON] Specifies the output format. | - | [default: TABLE] | - | --verbose -v Displays log entries for log levels `info` | - | and higher. | - | --debug Displays log entries for log levels `debug` | - | and higher; debug logs contains additional | - | information. | - | --silent Turns off intermediate output to console. | - +------------------------------------------------------------------------------+ - - - ''' -# --- -# name: test_help_messages[object.stage.list] - ''' - DeprecationWarning: The command 'stage' is deprecated. - `snow object stage` command group is deprecated. Please use `snow stage` instead. - - Usage: default object stage list [OPTIONS] STAGE_NAME - - (deprecated) - Lists the stage contents. - - +- Arguments ------------------------------------------------------------------+ - | * stage_name TEXT Name of the stage. [required] | - +------------------------------------------------------------------------------+ - +- Options --------------------------------------------------------------------+ - | --pattern TEXT Regex pattern for filtering files by name. For | - | example --pattern ".*\.txt" will filter only files | - | with .txt extension. | - | --help -h Show this message and exit. | - +------------------------------------------------------------------------------+ - +- Connection configuration ---------------------------------------------------+ - | --connection,--environment -c TEXT Name of the connection, as defined | - | in your `config.toml`. Default: | - | `default`. | - | --account,--accountname TEXT Name assigned to your Snowflake | - | account. Overrides the value | - | specified for the connection. | - | --user,--username TEXT Username to connect to Snowflake. | - | Overrides the value specified for | - | the connection. | - | --password TEXT Snowflake password. Overrides the | - | value specified for the | - | connection. | - | --authenticator TEXT Snowflake authenticator. Overrides | - | the value specified for the | - | connection. | - | --private-key-path TEXT Snowflake private key path. | - | Overrides the value specified for | - | the connection. | - | --token-file-path TEXT Path to file with an OAuth token | - | that should be used when | - | connecting to Snowflake | - | --database,--dbname TEXT Database to use. Overrides the | - | value specified for the | - | connection. | - | --schema,--schemaname TEXT Database schema to use. Overrides | - | the value specified for the | - | connection. | - | --role,--rolename TEXT Role to use. Overrides the value | - | specified for the connection. | - | --warehouse TEXT Warehouse to use. Overrides the | - | value specified for the | - | connection. | - | --temporary-connection -x Uses connection defined with | - | command line parameters, instead | - | of one defined in config | - | --mfa-passcode TEXT Token to use for multi-factor | - | authentication (MFA) | - | --enable-diag Run python connector diagnostic | - | test | - | --diag-log-path TEXT Diagnostic report path | - | --diag-allowlist-path TEXT Diagnostic report path to optional | - | allowlist | - +------------------------------------------------------------------------------+ - +- Global configuration -------------------------------------------------------+ - | --format [TABLE|JSON] Specifies the output format. | - | [default: TABLE] | - | --verbose -v Displays log entries for log levels `info` | - | and higher. | - | --debug Displays log entries for log levels `debug` | - | and higher; debug logs contains additional | - | information. | - | --silent Turns off intermediate output to console. | - +------------------------------------------------------------------------------+ - - - ''' -# --- -# name: test_help_messages[object.stage.remove] - ''' - DeprecationWarning: The command 'stage' is deprecated. - `snow object stage` command group is deprecated. Please use `snow stage` instead. - - Usage: default object stage remove [OPTIONS] STAGE_NAME FILE_NAME - - (deprecated) - Removes a file from a stage. - - +- Arguments ------------------------------------------------------------------+ - | * stage_name TEXT Name of the stage. [required] | - | * file_name TEXT Name of the file to remove. [default: None] | - | [required] | - +------------------------------------------------------------------------------+ - +- Options --------------------------------------------------------------------+ - | --help -h Show this message and exit. | - +------------------------------------------------------------------------------+ - +- Connection configuration ---------------------------------------------------+ - | --connection,--environment -c TEXT Name of the connection, as defined | - | in your `config.toml`. Default: | - | `default`. | - | --account,--accountname TEXT Name assigned to your Snowflake | - | account. Overrides the value | - | specified for the connection. | - | --user,--username TEXT Username to connect to Snowflake. | - | Overrides the value specified for | - | the connection. | - | --password TEXT Snowflake password. Overrides the | - | value specified for the | - | connection. | - | --authenticator TEXT Snowflake authenticator. Overrides | - | the value specified for the | - | connection. | - | --private-key-path TEXT Snowflake private key path. | - | Overrides the value specified for | - | the connection. | - | --token-file-path TEXT Path to file with an OAuth token | - | that should be used when | - | connecting to Snowflake | - | --database,--dbname TEXT Database to use. Overrides the | - | value specified for the | - | connection. | - | --schema,--schemaname TEXT Database schema to use. Overrides | - | the value specified for the | - | connection. | - | --role,--rolename TEXT Role to use. Overrides the value | - | specified for the connection. | - | --warehouse TEXT Warehouse to use. Overrides the | - | value specified for the | - | connection. | - | --temporary-connection -x Uses connection defined with | - | command line parameters, instead | - | of one defined in config | - | --mfa-passcode TEXT Token to use for multi-factor | - | authentication (MFA) | - | --enable-diag Run python connector diagnostic | - | test | - | --diag-log-path TEXT Diagnostic report path | - | --diag-allowlist-path TEXT Diagnostic report path to optional | - | allowlist | - +------------------------------------------------------------------------------+ - +- Global configuration -------------------------------------------------------+ - | --format [TABLE|JSON] Specifies the output format. | - | [default: TABLE] | - | --verbose -v Displays log entries for log levels `info` | - | and higher. | - | --debug Displays log entries for log levels `debug` | - | and higher; debug logs contains additional | - | information. | - | --silent Turns off intermediate output to console. | - +------------------------------------------------------------------------------+ - - - ''' -# --- -# name: test_help_messages[object.stage] - ''' - - Usage: default object stage [OPTIONS] COMMAND [ARGS]... - - (deprecated) - Manages stages. - - +- Options --------------------------------------------------------------------+ - | --help -h Show this message and exit. | - +------------------------------------------------------------------------------+ - +- Commands -------------------------------------------------------------------+ - | copy Copies all files from target path to target (deprecated) | - | directory. This works for both uploading to and | - | downloading files from the stage. | - | create Creates a named stage if it does not already exist. (deprecated) | - | list Lists the stage contents. (deprecated) | - | remove Removes a file from a stage. (deprecated) | - +------------------------------------------------------------------------------+ - - ''' # --- # name: test_help_messages[object] @@ -3222,14 +2804,11 @@ | --help -h Show this message and exit. | +------------------------------------------------------------------------------+ +- Commands -------------------------------------------------------------------+ - | create Create an object of a given type. Check | - | documentation for the list of supported objects | - | and parameters. | + | create Create an object of a given type. Check documentation for the | + | list of supported objects and parameters. | | describe Provides description of an object of given type. | | drop Drops Snowflake object of given name and type. | - | list Lists all available Snowflake objects of given | - | type. | - | stage Manages stages. (deprecated) | + | list Lists all available Snowflake objects of given type. | +------------------------------------------------------------------------------+ @@ -8309,29 +7888,6 @@ +------------------------------------------------------------------------------+ - ''' -# --- -# name: test_help_messages_no_help_flag[object.stage] - ''' - - Usage: default object stage [OPTIONS] COMMAND [ARGS]... - - (deprecated) - Manages stages. - - +- Options --------------------------------------------------------------------+ - | --help -h Show this message and exit. | - +------------------------------------------------------------------------------+ - +- Commands -------------------------------------------------------------------+ - | copy Copies all files from target path to target (deprecated) | - | directory. This works for both uploading to and | - | downloading files from the stage. | - | create Creates a named stage if it does not already exist. (deprecated) | - | list Lists the stage contents. (deprecated) | - | remove Removes a file from a stage. (deprecated) | - +------------------------------------------------------------------------------+ - - ''' # --- # name: test_help_messages_no_help_flag[object] @@ -8345,14 +7901,11 @@ | --help -h Show this message and exit. | +------------------------------------------------------------------------------+ +- Commands -------------------------------------------------------------------+ - | create Create an object of a given type. Check | - | documentation for the list of supported objects | - | and parameters. | + | create Create an object of a given type. Check documentation for the | + | list of supported objects and parameters. | | describe Provides description of an object of given type. | | drop Drops Snowflake object of given name and type. | - | list Lists all available Snowflake objects of given | - | type. | - | stage Manages stages. (deprecated) | + | list Lists all available Snowflake objects of given type. | +------------------------------------------------------------------------------+ diff --git a/tests/object/test_stage.py b/tests/object/test_stage.py deleted file mode 100644 index 783f03dd1..000000000 --- a/tests/object/test_stage.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2024 Snowflake Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import pytest - - -@pytest.mark.parametrize("command", ["copy", "create", "diff", "list", "remove"]) -def test_object_stage_commands_cause_a_warning(command, runner): - result = runner.invoke(["object", "stage", command, "--help"]) - assert result.exit_code == 0, result.output - assert "(deprecated)" in result.output - - -def test_object_stage_main_command_causes_a_warning(runner): - result = runner.invoke(["object", "stage", "--help"]) - assert result.exit_code == 0, result.output - assert "(deprecated)" in result.output diff --git a/tests/stage/test_diff.py b/tests/stage/test_diff.py index 969980d74..9c440c95e 100644 --- a/tests/stage/test_diff.py +++ b/tests/stage/test_diff.py @@ -359,7 +359,8 @@ def test_filter_from_diff(): def test_print_diff_to_console_no_bundlemap( - capsys, os_agnostic_snapshot, print_paths_as_posix + capsys, + os_agnostic_snapshot, ): diff = DiffResult() # Empty diff @@ -430,9 +431,7 @@ def test_print_diff_to_console_no_bundlemap( assert captured.out == os_agnostic_snapshot -def test_print_diff_to_console_with_bundlemap( - capsys, os_agnostic_snapshot, print_paths_as_posix -): +def test_print_diff_to_console_with_bundlemap(capsys, os_agnostic_snapshot): bundle_map = mock.MagicMock(spec=BundleMap, autospec=True) dest_to_project = {} bundle_map.to_project_path.side_effect = lambda dest_path: dest_to_project.get(