Skip to content

Commit

Permalink
touch for writing
Browse files Browse the repository at this point in the history
  • Loading branch information
jrybicki-jsc committed Feb 5, 2024
1 parent dd4b52c commit 075db20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mlflow_stagein.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def copy_model(connection_id, **context):


ssh_hook = get_connection(conn_id=connection_id, **context)
clt = ssh_hook.get_conn()
sftp_client = ssh_hook.get_conn().open_sftp()

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

sftp_client.exec_command(command=f"touch {target_name}")
clt.exec_command(command=f"touch {target_name}")
with sftp_client.open(target_name, "wb") as tr:
tr.set_pipelined(pipelined=True)
copy_streams(inp=sr, outp=tr)
Expand Down

0 comments on commit 075db20

Please # to comment.