Skip to content

Commit

Permalink
update stage diff command and message wording
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pjafari committed Dec 4, 2024
1 parent 3412b3c commit 08a4110
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/snowflake/cli/_plugins/stage/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def stage_diff(
Diffs a stage with a local folder.
"""
diff: DiffResult = compute_stage_diff(
local_root=Path(folder_name), stage_fqn=stage_name
local_root=Path(folder_name),
stage_path=StageManager._stage_path_part_factory(stage_name), # noqa: SLF001
)
if get_cli_context().output_format == OutputFormat.JSON:
return ObjectResult(diff.to_dict())
Expand Down
6 changes: 2 additions & 4 deletions src/snowflake/cli/_plugins/stage/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)
from snowflake.connector.cursor import DictCursor

from .manager import DefaultStagePathParts, StageManager
from .manager import StageManager, StagePathParts
from .md5 import UnknownMD5FormatError, file_matches_md5sum

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -122,9 +122,7 @@ def preserve_from_diff(
return preserved_diff


def compute_stage_diff(
local_root: Path, stage_path: DefaultStagePathParts
) -> DiffResult:
def compute_stage_diff(local_root: Path, stage_path: StagePathParts) -> DiffResult:
"""
Diffs the files in the local_root with files in the stage path that is stage_path_parts's full_path.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/cli/api/entities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def sync_deploy_root_with_stage(
# Perform a diff operation and display results to the user for informational purposes
if print_diff:
console.step(
f"Performing a diff between the Snowflake stage {stage_path.path} and your local deploy_root {deploy_root.resolve()} directory."
f"Performing a diff between the Snowflake stage: {stage_path.path} and your local deploy_root: {deploy_root.resolve()}."
)

diff: DiffResult = compute_stage_diff(
Expand Down

0 comments on commit 08a4110

Please sign in to comment.