Skip to content

fix: improve typings and remove mypy ignores#93

Open
timl3136 wants to merge 4 commits intocadence-workflow:mainfrom
timl3136:error-fix
Open

fix: improve typings and remove mypy ignores#93
timl3136 wants to merge 4 commits intocadence-workflow:mainfrom
timl3136:error-fix

Conversation

@timl3136
Copy link
Copy Markdown
Member

@timl3136 timl3136 commented Apr 23, 2026

What changed?
Improve typings and remove mypy ignores, also add clear mypy cache to make clean command

Why?
we should not use ignore to override type safety check.

How did you test it?
only typing improvements

Potential risks

Release notes

Documentation Changes


Summary by Gitar

  • Typing improvements:
    • Explicitly cast call_details.method to bytes in retry.py to handle runtime type changes in grpcio v1.75.0+.
    • Added cast in test suites to resolve type mismatches in GetWorkflowExecutionHistory responses and StartWorkflowOptions dictionary mocking.

This will update automatically on new commits.

Comment thread cadence/_internal/rpc/retry.py Outdated
Signed-off-by: Tim Li <ltim@uber.com>
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 23, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Refactored typings and removed redundant mypy ignores throughout the codebase. The comparison logic in is_retryable was corrected to handle decoded strings instead of bytes constants.

✅ 1 resolved
Bug: is_retryable compares decoded str to bytes constant

📄 cadence/_internal/rpc/retry.py:47 📄 cadence/_internal/rpc/retry.py:105-109
At line 109 in retry.py, method has been decoded from bytes to str (line 106-107), but GET_WORKFLOW_HISTORY is defined as b"..." (bytes) on line 47. The comparison method == GET_WORKFLOW_HISTORY will always be False, breaking the retry-on-passive-side logic for GetWorkflowExecutionHistory. This means EntityNotExistsError from cross-cluster requests will no longer be retried.

If method is already a str (not bytes), the decode branch is skipped but the comparison still fails because the constant is bytes.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

1 participant