Skip to content

Commit 075db20

Browse files
committed
touch for writing
1 parent dd4b52c commit 075db20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlflow_stagein.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def copy_model(connection_id, **context):
4747

4848

4949
ssh_hook = get_connection(conn_id=connection_id, **context)
50+
clt = ssh_hook.get_conn()
5051
sftp_client = ssh_hook.get_conn().open_sftp()
5152

5253
with open(ret, "rb") as sr:
@@ -55,7 +56,7 @@ def copy_model(connection_id, **context):
5556
if file_exist(sftp=sftp_client, name=target_name):
5657
print(target_name," exists. Overwritting.")
5758

58-
sftp_client.exec_command(command=f"touch {target_name}")
59+
clt.exec_command(command=f"touch {target_name}")
5960
with sftp_client.open(target_name, "wb") as tr:
6061
tr.set_pipelined(pipelined=True)
6162
copy_streams(inp=sr, outp=tr)

0 commit comments

Comments
 (0)