Skip to content

Commit

Permalink
Removed or None
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astus committed Nov 15, 2024
1 parent 91abd4d commit cfb17bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/snowflake/cli/_plugins/snowpark/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 1 addition & 10 deletions src/snowflake/cli/_plugins/snowpark/snowpark_project_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit cfb17bf

Please sign in to comment.