Skip to content

Commit

Permalink
Better Error MSG, very nice PR Wayner
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier committed Nov 14, 2024
1 parent 579be9d commit 90510c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion flytekit/core/container_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def _render_command_and_volume_binding(self, cmd: str, **kwargs) -> Tuple[str, D
if type(input_val) in [FlyteFile, FlyteDirectory]:
if not path_k:
raise AssertionError(
"FlyteFile and FlyteDirectory commands should not use the syntax: {{.inputs.infile}}"
"FlyteFile and FlyteDirectory commands should not use the template syntax like this: {{.inputs.infile}}\n"
"Please use a path-like syntax, such as: /var/inputs/infile.\n"
"This requirement is due to how Flyte Propeller processes template syntax inputs."
)
local_flyte_file_or_dir_path = str(input_val)
remote_flyte_file_or_dir_path = os.path.join(self._input_data_dir, k) # type: ignore
Expand Down
5 changes: 4 additions & 1 deletion tests/flytekit/unit/core/test_local_raw_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def flyte_file_io_wf() -> FlyteFile:
return flyte_file_io(inputs=ff)

with pytest.raises(
AssertionError, match="FlyteFile and FlyteDirectory commands should not use the syntax: {{.inputs.infile}}"
AssertionError,
match="FlyteFile and FlyteDirectory commands should not use the template syntax like this: {{.inputs.infile}}\n"
"Please use a path-like syntax, such as: /var/inputs/infile.\n"
"This requirement is due to how Flyte Propeller processes template syntax inputs."
):
flyte_file_io_wf()

Expand Down

0 comments on commit 90510c2

Please sign in to comment.