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

Workflow cmds #180

Merged
merged 30 commits into from
Jan 22, 2025
Merged

Workflow cmds #180

merged 30 commits into from
Jan 22, 2025

Conversation

manojdbos
Copy link
Contributor

@manojdbos manojdbos commented Jan 17, 2025

dbos workflow list
dbos workflow get
dbos workflow cancel

@manojdbos
Copy link
Contributor Author

FYI:

I have used WorkflowStatusInternal class and _sys_db method to get workflow status. There is also a WorkflowStatus exposed by the dbos class. If you prefer that we use that, let me know

@manojdbos manojdbos marked this pull request as ready for review January 17, 2025 22:57
@qianl15 qianl15 linked an issue Jan 17, 2025 that may be closed by this pull request
dbos/_workflow_commands.py Outdated Show resolved Hide resolved
dbos/_workflow_commands.py Outdated Show resolved Hide resolved
dbos/_workflow_commands.py Outdated Show resolved Hide resolved
@qianl15
Copy link
Member

qianl15 commented Jan 21, 2025

Found a minor bug in _sys_db.py: "SAWarning: UPDATE statement has a cartesian product between FROM element(s) "dbos.workflow_status" and FROM element "dbos.workflow_inputs". Apply join condition(s) between each element to resolve."

It's in set_workflow_status function.

@manojdbos
Copy link
Contributor Author

Found a minor bug in _sys_db.py: "SAWarning: UPDATE statement has a cartesian product between FROM element(s) "dbos.workflow_status" and FROM element "dbos.workflow_inputs". Apply join condition(s) between each element to resolve."

It's in set_workflow_status function.

Fixed

Copy link
Member

@qianl15 qianl15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

dbos/cli.py Outdated Show resolved Hide resolved
workflows = _list_workflows(
config, limit, user, starttime, endtime, status, request, appversion
)
print(jsonpickle.encode(workflows, unpicklable=False))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use a standard string representation, not jsonpickle, for readability?

Copy link
Contributor Author

@manojdbos manojdbos Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean print it out field by field with our own formatting ?
This is a list of workflowInformation. Python does not know how to serialize it
Even the field by field might not work as there are some fields like input that python might not be able to serialize

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python might not be able to serialize it, but it can (almost) always stringify it to print it in a human-readable format. My worry with jsonpickle is that its outputs are often not human-readable. In your testing, how does it look it a workflow, say, returns a list? Is it printed in a human-readable format?

@manojdbos manojdbos merged commit a529b4c into main Jan 22, 2025
5 checks passed
@manojdbos manojdbos deleted the workflow-cmds branch January 22, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python API to cancel workflow
3 participants