Skip to content

cloudpickle isinstance() #487

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

Merged
merged 3 commits into from
Nov 9, 2024
Merged
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
8 changes: 6 additions & 2 deletions executorlib/cache/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def backend_load_file(file_name: str) -> dict:
"""
apply_dict = load(file_name=file_name)
apply_dict["args"] = [
arg if not isinstance(arg, FutureItem) else arg.result()
arg if not _isinstance(arg, FutureItem) else arg.result()
for arg in apply_dict["args"]
]
apply_dict["kwargs"] = {
key: arg if not isinstance(arg, FutureItem) else arg.result()
key: arg if not _isinstance(arg, FutureItem) else arg.result()
for key, arg in apply_dict["kwargs"].items()
}
return apply_dict
Expand Down Expand Up @@ -62,3 +62,7 @@ def backend_execute_task_in_file(file_name: str) -> None:
file_name=file_name,
output=result,
)


def _isinstance(obj: Any, cls: type) -> bool:
return str(obj.__class__) == str(cls)
Loading