Skip to content

Commit a7d442d

Browse files
authored
Merge branch 'master' into feature-3563-add-lambda-func-parameters
2 parents 0181d9d + 48a90a5 commit a7d442d

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/sagemaker/feature_store/feature_group.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,12 @@ class FeatureGroup:
473473
Attributes:
474474
name (str): name of the FeatureGroup instance.
475475
sagemaker_session (Session): session instance to perform boto calls.
476+
If None, a new Session will be created.
476477
feature_definitions (Sequence[FeatureDefinition]): list of FeatureDefinitions.
477478
"""
478479

479480
name: str = attr.ib(factory=str)
480-
sagemaker_session: Session = attr.ib(default=Session)
481+
sagemaker_session: Session = attr.ib(factory=Session)
481482
feature_definitions: Sequence[FeatureDefinition] = attr.ib(factory=list)
482483

483484
_INTEGER_TYPES = [

src/sagemaker/git_utils.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _clone_command_for_github_like(git_config, dest_dir):
174174
CalledProcessError: If failed to clone git repo.
175175
"""
176176
is_https = git_config["repo"].startswith("https://")
177-
is_ssh = git_config["repo"].startswith("git@")
177+
is_ssh = git_config["repo"].startswith("git@") or git_config["repo"].startswith("ssh://")
178178
if not is_https and not is_ssh:
179179
raise ValueError("Invalid Git url provided.")
180180
if is_ssh:
@@ -277,12 +277,16 @@ def _run_clone_command(repo_url, dest_dir):
277277
if repo_url.startswith("https://"):
278278
my_env["GIT_TERMINAL_PROMPT"] = "0"
279279
subprocess.check_call(["git", "clone", repo_url, dest_dir], env=my_env)
280-
elif repo_url.startswith("git@"):
281-
with tempfile.NamedTemporaryFile() as sshnoprompt:
282-
with open(sshnoprompt.name, "w") as write_pipe:
283-
write_pipe.write("ssh -oBatchMode=yes $@")
284-
os.chmod(sshnoprompt.name, 0o511)
285-
my_env["GIT_SSH"] = sshnoprompt.name
280+
elif repo_url.startswith("git@") or repo_url.startswith("ssh://"):
281+
try:
282+
with tempfile.NamedTemporaryFile() as sshnoprompt:
283+
with open(sshnoprompt.name, "w") as write_pipe:
284+
write_pipe.write("ssh -oBatchMode=yes $@")
285+
os.chmod(sshnoprompt.name, 0o511)
286+
my_env["GIT_SSH"] = sshnoprompt.name
287+
subprocess.check_call(["git", "clone", repo_url, dest_dir], env=my_env)
288+
except subprocess.CalledProcessError:
289+
del my_env["GIT_SSH"]
286290
subprocess.check_call(["git", "clone", repo_url, dest_dir], env=my_env)
287291

288292

0 commit comments

Comments
 (0)