Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default callback_filter in update_metadata #721

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading