Skip to content

latch_cli.services.launch.launch_v2.Execution.id is typed as str and not int #561

@msto

Description

@msto

[REQUIRED] Describe the bug

The id of a launched Execution is typed as str. In practice, the ID is returned as an int.

@dataclass
class Execution:
id: str

[REQUIRED] To Reproduce
Steps to reproduce the behavior:

  1. Launch an execution.
  2. Look at the type of the returned execution's id.
>>> execution: launch_v2.Execution = launch_v2.launch(...)
>>> execution
Execution(id=872009, python_outputs={}, status='UNDEFINED', outputs_url=None, flytedb_id=None)
>>> type(execution.id)
<class 'int'>

[REQUIRED] Expected behavior

Either the type of the Execution.id attribute should be changed to int, or the behavior of launch_workflow() should be updated to coerce the int returned by GQL to str before creating the Execution instance.

@dataclass
class Execution:
id: str

execution_id = response_data.get("metadata", {}).get("execution_id")
if execution_id is None:
raise RuntimeError("Workflow launch failed - no execution id returned")
return Execution(id=execution_id, python_outputs=python_outputs)

[REQUIRED] Platform Information
General information about host platform + SDK

  • OS: MacOS 14.7.1
  • Browser: N/A
  • Latch Version: 2.66.3

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions