Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Apr 3, 2024
1 parent 167527a commit 8512bc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions flytekit/core/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def extract_task_module(f: Union[Callable, TrackedInstance]) -> Tuple[str, str,
if mod_name == "__main__":
if hasattr(f, "task_function"):
f = f.task_function
# If the module is __main__, we need to find the actual module name based on the file path
inspect_file = inspect.getfile(f) # type: ignore
file_name, _ = os.path.splitext(os.path.basename(inspect_file))
mod_name = get_full_module_path(f, file_name) # type: ignore
Expand Down
2 changes: 2 additions & 0 deletions flytekit/remote/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,8 @@ def register_task(
:param version: version that will be used to register. If not specified will default to using the serialization settings default
:return:
"""
# Create a default serialization settings object if not provided
# It makes registration easier for the user
if serialization_settings is None:
_, _, _, module_file = extract_task_module(entity)
project_root = _find_project_root(module_file)
Expand Down

0 comments on commit 8512bc6

Please sign in to comment.