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

Remove enum_values keywords in serialization #565

Closed
wants to merge 8 commits into from
Closed
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
6 changes: 2 additions & 4 deletions src/jobflow/core/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,7 @@ def run(self, store: jobflow.JobStore) -> Response:
pass_manager_config(response.replace, passed_config)

try:
output = jsanitize(
response.output, strict=True, enum_values=True, allow_bson=True
)
output = jsanitize(response.output, strict=True, allow_bson=True)
except AttributeError as err:
raise RuntimeError(
"Job output contained an object that is not MSONable and therefore "
Expand Down Expand Up @@ -1106,7 +1104,7 @@ def as_dict(self) -> dict:

# fireworks can't serialize functions and classes, so explicitly serialize to
# the job recursively using monty to avoid issues
return jsanitize(d, strict=True, enum_values=True, allow_bson=True)
return jsanitize(d, strict=True, allow_bson=True)

def __setattr__(self, key, value):
"""Handle setting attributes. Implements a special case for job name."""
Expand Down
4 changes: 2 additions & 2 deletions src/jobflow/core/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def find_and_get_references(arg: Any) -> tuple[OutputReference, ...]:
# argument is a primitive, we won't find a reference here
return ()

arg = jsanitize(arg, strict=True, enum_values=True, allow_bson=True)
arg = jsanitize(arg, strict=True, allow_bson=True)

# recursively find any reference classes
locations = find_key_value(arg, "@class", "OutputReference")
Expand Down Expand Up @@ -458,7 +458,7 @@ def find_and_resolve_references(
return arg

# serialize the argument to a dictionary
encoded_arg = jsanitize(arg, strict=True, enum_values=True, allow_bson=True)
encoded_arg = jsanitize(arg, strict=True, allow_bson=True)

# recursively find any reference classes
locations = find_key_value(encoded_arg, "@class", "OutputReference")
Expand Down
Loading