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

Catch error in sdk when workflow instance not found #771

Merged
merged 6 commits into from
Jan 28, 2025

Conversation

elena-kolevska
Copy link
Contributor

@elena-kolevska elena-kolevska commented Jan 28, 2025

Description

Catches error from daprd in the sdk when workflow instance not found, so that users don't have to do try/catch in the app.
Instead, when daprd can't find the workflow instance get_workflow_state will return None, as specified in the doc comment.

Also adds a small demo workflows examples fix.

Issue reference

#745

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests

Release Note

RELEASE NOTE: FIX Return None instead of throwing an error when a workflow instance is not found

@elena-kolevska elena-kolevska requested review from a team as code owners January 28, 2025 12:37
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-1.15@7d05d6f). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff               @@
##             release-1.15     #771   +/-   ##
===============================================
  Coverage                ?   86.29%           
===============================================
  Files                   ?       89           
  Lines                   ?     5029           
  Branches                ?        0           
===============================================
  Hits                    ?     4340           
  Misses                  ?      689           
  Partials                ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@ajstewart ajstewart left a comment

Choose a reason for hiding this comment

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

On second thought I do see the sense of wrapping the not found to a None return and raising anything else. Seeing if it's there or not will be the most common check I imagine.

I have a question on the detection of the not found.

Signed-off-by: Elena Kolevska <[email protected]>
@elena-kolevska elena-kolevska merged commit 488189e into dapr:release-1.15 Jan 28, 2025
15 checks passed
@elena-kolevska elena-kolevska deleted the release-1.15 branch January 28, 2025 22:24
@elena-kolevska elena-kolevska modified the milestones: v1.15, workflow-0.6.0 Jan 28, 2025
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.

2 participants