[Bug]: durable_execution(plugins=...) return type fails mypy with "Too few arguments"
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- aws, python
Hướng nghiên cứu
Start with execution.py in packages/aws-durable-execution-sdk-python/src, where durable_execution is declared with one signature and its return type is Callable[[Any, LambdaContext], Any] for both call forms. Reproduce by running mypy on telemetry_3_result_select.py in the conformance-tests-telemetry package. Done when the two-overload form type-checks for both @durable_execution and @durable_execution(plugins=...), and a test under the SDK's tests directory covers the decorator-factory form.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected Behavior
@durable_execution(plugins=[...]) applied to a def handler(event, context) passes mypy.
Actual Behavior
mypy 2.4.1 reports error: Too few arguments [call-arg] on the @durable_execution( line. Three call sites on main show it:
packages/aws-durable-execution-sdk-python-conformance-tests-telemetry/src/telemetry_1_success.py:42packages/aws-durable-execution-sdk-python-conformance-tests-telemetry/src/telemetry_3_result_select.py:66packages/aws-durable-execution-sdk-python-conformance-tests-otel/src/otel_5_child_context.py:30
Cause. durable_execution has one signature: execution.py:169-174. Its declared return type is Callable[[Any, LambdaContext], Any] for both call forms. When func is None, the function returns a decorator at runtime (execution.py:187-191). The declared type is still the two-argument handler. The decorator syntax then applies that two-argument type to the user function with one argument. So mypy reports Too few arguments.
CI does not catch it. .github/scripts/type-checks.sh runs mypy on five packages. It excludes the three conformance-test packages, which hold every plugins= call site.
Steps to Reproduce
mypy packages/aws-durable-execution-sdk-python-conformance-tests-telemetry/src/telemetry_3_result_select.py
SDK Version
main at 93751c46
Python Version
3.14
Is this a regression?
No
Last Working Version
No response
Additional Context
Proposed fix: two @overloads on durable_execution.
funcgiven positionally → returnsCallable[[Any, LambdaContext], Any].func: None = Nonewith keyword-onlyboto3_clientandplugins→ returnsCallable[[Callable[[Any, DurableContext], Any]], Callable[[Any, LambdaContext], Any]].
Add a test under packages/aws-durable-execution-sdk-python/tests that uses both call forms, so types:check covers the decorator-factory form.
Raised by @ParidelPooya in the #916 review.
- Ngôn ngữ chính
- Python
- Star
- 58
- Fork
- 32
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 80
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/aws-durable-execution-sdk-python
-
enhancement needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
aws/aws-durable-execution-sdk-python#927 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws/aws-durable-execution-sdk-python#875 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
aws/aws-durable-execution-sdk-python#794 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: JS examples CI still invokes Jest after Vitest migrationCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
aws/aws-durable-execution-sdk-python#918 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug pkg:telemetry
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aws/aws-durable-execution-sdk-python#908 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws/aws-durable-execution-sdk-python
Issue tương tự
-
enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Community
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kedro-org/kedro-plugins#1575 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hive size:simple
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Significant-Gravitas/AutoGPT#16733 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
changelog investigate
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
ramnes/notion-sdk-py#444 ·