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

Python SDK workflow updates #4563

Draft
wants to merge 1 commit into
base: v1.15
Choose a base branch
from
Draft

Conversation

hhunter-ms
Copy link
Collaborator

@hhunter-ms hhunter-ms commented Feb 28, 2025

Description

  • Update Python examples in "How to Author"
  • Update Python examples in "How to Manage"
  • Update quickstart examples

Extra item:

  • Update Python example in Conversation quickstart from HTTP to SDK

Issue reference

PR will close: #4410

…o python sdk

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
@hhunter-ms hhunter-ms self-assigned this Feb 28, 2025
@hhunter-ms hhunter-ms requested review from a team as code owners February 28, 2025 21:38
@hhunter-ms hhunter-ms marked this pull request as draft February 28, 2025 21:38
Copy link

github-actions bot commented Mar 6, 2025

Stale PR, paging all reviewers

@github-actions github-actions bot added the stale label Mar 6, 2025
from dapr.conf import settings
from dapr.conf.helpers import GrpcEndpoint
from dapr.ext.workflow.logger import LoggerOptions, Logger

Copy link
Member

Choose a reason for hiding this comment

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

Where did you get this example? I do not think you need all these imports. Can we check with Elena?
+++++++++++++++++++++++++++++
from durabletask import worker, task

from dapr.ext.workflow.workflow_context import Workflow
from dapr.ext.workflow.dapr_workflow_context import DaprWorkflowContext
from dapr.ext.workflow.workflow_activity_context import Activity, WorkflowActivityContext
from dapr.ext.workflow.util import getAddress

from dapr.clients import DaprInternalError
from dapr.clients.http.client import DAPR_API_TOKEN_HEADER
from dapr.conf import settings
from dapr.conf.helpers import GrpcEndpoint
from dapr.ext.workflow.logger import LoggerOptions, Logger

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, there are some unused imports here, and some indentation problems, which will make the snippet error out.
I also think it's important to show the workflow definition.

This should be a good starting point for the example: https://github.com/dapr/python-sdk/blob/release-1.15/examples/workflow/simple.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Python example for Conversation Quickstart should be the SDK, not HTTP Python SDK docs are outdated
3 participants