Skip to content

Commit

Permalink
Agent uploads input.pb even if task input is None (#2054)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw authored Dec 15, 2023
1 parent f1f8aef commit 7f7272f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flytekit/core/data_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(
self._local = fsspec.filesystem(None)

self._data_config = data_config if data_config else DataConfig.auto()
self._default_protocol = get_protocol(raw_output_prefix)
self._default_protocol = get_protocol(str(raw_output_prefix))
self._default_remote = cast(fsspec.AbstractFileSystem, self.get_filesystem(self._default_protocol))
if os.name == "nt" and raw_output_prefix.startswith("file://"):
raise FlyteAssertion("Cannot use the file:// prefix on Windows.")
Expand Down
5 changes: 2 additions & 3 deletions flytekit/extend/backend/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,10 @@ async def _create(
literals = inputs or {}
for k, v in inputs.items():
literals[k] = TypeEngine.to_literal(ctx, v, type(v), self._entity.interface.inputs[k].type)
literal_map = LiteralMap(literals) if literals else None
if literal_map and isinstance(self, PythonFunctionTask):
if isinstance(self, PythonFunctionTask):
# Write the inputs to a remote file, so that the remote task can read the inputs from this file.
path = ctx.file_access.get_random_local_path()
utils.write_proto_to_file(literal_map.to_flyte_idl(), path)
utils.write_proto_to_file(LiteralMap(literals).to_flyte_idl(), path)
ctx.file_access.put_data(path, f"{output_prefix}/inputs.pb")
task_template = render_task_template(task_template, output_prefix)

Expand Down

0 comments on commit 7f7272f

Please sign in to comment.