Skip to content

Commit

Permalink
Merge pull request #721 from esoteric-ephemera/main
Browse files Browse the repository at this point in the history
Change default callback_filter in update_metadata
  • Loading branch information
utf authored Dec 18, 2024
2 parents ffc27cf + 35aee12 commit ba0db5a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/jobflow/core/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def update_metadata(
function_filter: Callable = None,
dict_mod: bool = False,
dynamic: bool = True,
callback_filter: Callable[[Flow | Job], bool] = lambda _: True,
callback_filter: Callable[[Flow | Job], bool] | None = None,
):
"""
Update the metadata of the Flow and/or its Jobs.
Expand Down Expand Up @@ -681,7 +681,7 @@ def update_metadata(
callback_filter=callback_filter,
)

if callback_filter(self) is False:
if callback_filter is not None and callback_filter(self) is False:
return

if dict_mod:
Expand Down
4 changes: 2 additions & 2 deletions src/jobflow/core/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ def update_metadata(
function_filter: Callable = None,
dict_mod: bool = False,
dynamic: bool = True,
callback_filter: Callable[[jobflow.Flow | Job], bool] = lambda _: True,
callback_filter: Callable[[jobflow.Flow | Job], bool] | None = None,
):
"""
Update the metadata of the job.
Expand Down Expand Up @@ -1006,7 +1006,7 @@ def update_metadata(
):
return

if callback_filter(self) is False:
if callback_filter is not None and callback_filter(self) is False:
return

# if we get to here then we pass all the filters
Expand Down
5 changes: 4 additions & 1 deletion src/jobflow/utils/uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@


@deprecated(
message="The UUID system will be replace with UID that contains both UUID and ULID."
message=(
"The UUID system will be replaced with a UID that "
"contains both the UUID and ULID."
)
)
def suuid() -> str:
"""
Expand Down

0 comments on commit ba0db5a

Please sign in to comment.