From cfb17bf3417e35ee64c785f1eccb38ec71452926 Mon Sep 17 00:00:00 2001 From: Adam Stus Date: Thu, 14 Nov 2024 17:35:37 +0100 Subject: [PATCH] Removed or None --- src/snowflake/cli/_plugins/snowpark/commands.py | 4 +--- .../cli/_plugins/snowpark/snowpark_project_paths.py | 11 +---------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/snowflake/cli/_plugins/snowpark/commands.py b/src/snowflake/cli/_plugins/snowpark/commands.py index 23bdc2b931..cbe9cea568 100644 --- a/src/snowflake/cli/_plugins/snowpark/commands.py +++ b/src/snowflake/cli/_plugins/snowpark/commands.py @@ -390,9 +390,7 @@ def build( project_root=artefact.project_root, deploy_root=project_paths.deploy_root, ) - bundle_map.add( - PathMapping(src=str(artefact.path), dest=(artefact.dest or None)) - ) + bundle_map.add(PathMapping(src=str(artefact.path), dest=artefact.dest)) if artefact.path.is_file(): for (absolute_src, absolute_dest) in bundle_map.all_mappings( diff --git a/src/snowflake/cli/_plugins/snowpark/snowpark_project_paths.py b/src/snowflake/cli/_plugins/snowpark/snowpark_project_paths.py index f81de76960..cbc05e2c2d 100644 --- a/src/snowflake/cli/_plugins/snowpark/snowpark_project_paths.py +++ b/src/snowflake/cli/_plugins/snowpark/snowpark_project_paths.py @@ -14,7 +14,7 @@ from __future__ import annotations import glob -import os.path +import os import re from dataclasses import dataclass from pathlib import Path, PurePosixPath @@ -105,9 +105,6 @@ def _artefact_name(self) -> str: last_part = os.path.commonpath( [str(self.path), str(self.path.absolute())] ) - raise ValueError("Doopa") - # before_wildcard = str(self.path).split("*")[0] - # last_part = Path(before_wildcard).absolute().parts[-1] return last_part + ".zip" if (self.project_root / self.path).is_dir(): return self.path.stem + ".zip" @@ -165,18 +162,12 @@ def _is_dest_a_file(self) -> bool: return re.search(r"\.[a-zA-Z0-9]{2,4}$", self.dest) is not None def _path_until_asterisk(self) -> Path: - # before_wildcard = str(self.path).split("*")[0] - # parts = Path(before_wildcard).parts[:-1] - # return Path(*parts) - path = [] for part in self.path.parts: if glob.has_magic(part): break else: path.append(part) - # before_wildcard = str(self.path).split("*")[0] - # parts = Path(before_wildcard).parts[:-1] return Path(*path[:-1]) # Can be removed after removing ENABLE_SNOWPARK_GLOB_SUPPORT feature flag.