[BUG] ctx.triggered_id is not recognized as a dict
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
- 63/100
Hướng nghiên cứu
Issue không nêu tên tệp nguồn hay bài kiểm thử nào; hãy bắt đầu từ định nghĩa Python của ctx.triggered_id và kiểu của ngữ cảnh callback. Tái hiện cách truy cập bằng pattern matching với các phiên bản Dash được liệt kê, sau đó xác minh rằng phân tích tĩnh cho phép truy cập dictionary trong khi trường hợp không có trigger vẫn được biểu diễn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe your context
Please provide us your environment, so we can easily reproduce the issue.
dash 4.4.1
dash_ag_grid 35.3.0
dash-extensions 2.0.6
dash-iconify 0.1.2
dash_mantine_components 2.8.0
Describe the bug
I am defining multiple dynamic components and set their id like this:
id={"type": "entry", "index": id},
where the value of "index" gets changed depending on the component.
Now, when I want to use the id in a pattern-matching callback, I need to get the value of "index"to search a sqlite database. When I use
ctx.triggered_id.get("index"))
however, VS Code produces an error and says: ""get" is no known attribute of "None"". The call however correctly returns the value of "index"
The same problem happens with ctx.triggered_id["index"], although the error then says: "None" object is not subscriptable.
FYI: I translated the error messages from German to English. They could be slightly inaccurate, though their meaning should be correct
Expected behavior
I would expect it to see a dict as a possible type of triggered_id, so that there is no error shown.
- Ngôn ngữ chính
- Python
- Star
- 24.4k
- Fork
- 2.3k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 19
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 plotly/dash
-
good first issue P3 size: 1 task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
enhancement P2 size: 5
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
-
enhancement P3 size: 10+
-
P2 size: 1 task
-
enhancement P3 size: 1
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·