Repository navigation
Fix more type errors - #977
Fix more type errors #977
Conversation
|
|
||
|
|
||
| class MetricCounter(MetricCommon): | ||
| class MetricCounter(MetricCommon, ABC): |
There was a problem hiding this comment.
This is interesting. Is re-inheriting ABC at every level a general Python preference or just a preference of a certain tool?
There was a problem hiding this comment.
Hm, actually that's basedpyright-specific. I'm going to revert it.
| **_WorkflowExternFunctions( | ||
| __temporal_opentelemetry_completed_span=self._completed_workflow_span, | ||
| ) | ||
| { | ||
| "__temporal_opentelemetry_completed_span": self._completed_workflow_span, | ||
| } |
There was a problem hiding this comment.
What is the harm in using the constructor form of the TypedDict here instead of the dict literal with string literals?
There was a problem hiding this comment.
I couldn't see how to make it work with pyright (and your comment already indicated mypy probelems)
$ uv run pyright
/Users/dan/src/temporalio/sdk-python/temporalio/contrib/opentelemetry.py
/Users/dan/src/temporalio/sdk-python/temporalio/contrib/opentelemetry.py:130:15 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "(...) -> Unknown" in function "update"
Type "object" is not assignable to type "(...) -> Unknown" (reportArgumentType)
There was a problem hiding this comment.
Yeah, unfortunate that we can't use that nice constructor-like kwarg approach afforded to us by typed dicts
382ee2c to
621525c
Compare
Paramaterize OpenAI agents with context type in test
621525c to
471f57b
Compare
There was a problem hiding this comment.
Bug: Test Validation Silently Ignores Unexpected Errors
The test validation function no longer fails on unexpected type errors. A removed loop previously ensured tests failed if any type errors occurred beyond those explicitly expected via assertion comments. Now, such unexpected errors are silently ignored, reducing test strictness and potentially masking new type issues or regressions.
tests/test_type_errors.py#L84-L90
sdk-python/tests/test_type_errors.py
Lines 84 to 90 in 3c8c009
Was this report helpful? Give feedback by reacting with 👍 or 👎
I removed this assertion because it was failing on |
* Fix type errors * Do not make drive-by check for other type errors
* Fix type errors * Do not make drive-by check for other type errors Migrated-From: temporalio/sdk-python@7c57a76
* Fix type errors * Do not make drive-by check for other type errors Migrated-From: temporalio/sdk-python@7c57a76

Miscellaneous type error fixes, making progress towards fixing them all, opening PR for this subset since this is how many got done right now and we don't want them to pick up conflicts.
Reviewers: the commit named "interesting" contains slightly more interesting fixes.