Inputs type annotation mismatch
Maintainer thường phản hồi trong vòng 7 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- data-engineering, data-visualization
Hướng nghiên cứu
Tái hiện các ví dụ bằng Driver.execute(...), inputs và Builder.build(), sau đó theo dõi việc xác thực kiểu đầu vào và quá trình kết xuất visualization được đề cập trong issue. Issue liệt kê một số kết quả có thể xảy ra thay vì một bản sửa lỗi đã được chọn, vì vậy để hoàn tất cần có hành vi được thống nhất, coverage cho trường hợp external_input không khớp và cách xử lý hoặc hiển thị rõ ràng hơn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is a scenario that happened to a user and we could surface better errors
Current behavior
Take a look at the type annotations for external_input. The current dataflow definition is valid because the types are deemed equivalent (Any is special, it is both a subclass and super class of all types, including MyClass)
from typing import Any
class MyClass:
def __init__(self):
...
def foo(external_input: MyClass) -> int:
return 1
def bar(external_input: Any) -> int:
return 2
def join_nodes(foo: int, bar: int) -> int:
return foo + bar
The problem happens when calling Driver.execute(...) and specifying external_input. If the user expects it to take Any and pass a value that's not MyClass, the input validation will say that there's a type mismatch without more details.
inputs = {"external_input": 31}
dr.execute(["join_nodes"], inputs=inputs)
Additionally, because of the way visualizations are rendered, the two external_input will appear with the same type despite being annotated differently.
Also, the problem is specific to inputs. The following DAG wouldn't raise an error despite the object not matching the annotated type because there's no runtime type validation by default:
from typing import Any
class MyClass:
def __init__(self):
...
def internal_input() -> MyClass:
return 31
def foo(internal_input: MyClass) -> int:
return 1
def bar(internal_input: Any) -> int:
return 2
def join_nodes(foo: int, bar: int) -> int:
return foo + bar
dr.execute(["join_nodes"])
Potential solutions
- we could have better errors on input type validation
- we could warn that nodes are annotated differently but with valid types at
Builder.build()time - display the different type annotations in the visualization (I suggest against because it would be confusing since it can only be "one type at a time")
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 2.6k
- Fork
- 228
- Merge trung bình
- 8 ngày 9 phút
- Pull request đã merge (30 ngày)
- 27
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 apache/hamilton
-
FunctionInputOutputTypeChecker rejects correct values for fixed-length tuple annotations (tuple[int, str])Có thể đã có người làm @tarang-tp đã nhận 10 ngày trước. Đang mởbug core-work
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 7 ngày
-
Engine crashes when client sends nan or inf float to UICó thể làm lại được @Exudev đã nhận 253 ngày trước và không có pull request nào đang mở. Đang mởbug SDK
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/hamilton#1458 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 7 ngày
-
More detailed type annotations in graph visualizationsCó thể làm lại được @Nishant-Manocha đã nhận 388 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
apache/hamilton#1383 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 7 ngày
-
Documentation: add explainer for FastAPICó thể làm lại được @Aditya-Deshwal23 đã nhận 207 ngày trước và không có pull request nào đang mở. Đang mởdocumentation
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 65/100
apache/hamilton#1304 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 7 ngày
-
Link back to github from reference API docsCó thể đã có người làm @naikvaib đã nhận 45 ngày trước. Đang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/hamilton#572 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 7 ngày
Tất cả issue của apache/hamilton
Issue tương tự
-
qa_bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA-NeMo/Gym#5644 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug libcudf
Độ 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 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
light-curve/light-curve-python#870 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug c/evals size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Arize-ai/phoenix#17625 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày