Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
Merge pull request #54 from whimo/patch-1
Browse files Browse the repository at this point in the history
Retreive name from kwargs in LunaryCallbackHandler.on_chain_start
  • Loading branch information
hughcrt authored Sep 30, 2024
2 parents e2f667e + d4a370b commit 9ea7cc2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lunary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,16 +1151,19 @@ def on_chain_start(
parent_run_id: Union[UUID, None] = None,
tags: Union[List[str], None] = None,
metadata: Union[Dict[str, Any], None] = None,
name: Union[str, None] = None,
**kwargs: Any,
) -> Any:
try:
run = run_manager.start_run(run_id, parent_run_id)

name = (
serialized.get("id", [None, None, None, None])[3]
if len(serialized.get("id", [])) > 3
else None
)
if name is None and serialized:
name = (
serialized.get("id", [None, None, None, None])[3]
if len(serialized.get("id", [])) > 3
else None
)

type = "chain"
metadata = metadata or {}

Expand Down

0 comments on commit 9ea7cc2

Please sign in to comment.