Query-algebra spec: restriction by an expression with no common attributes, and restricting dj.U() aggregates
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- databases, documentation
Hướng nghiên cứu
Start with make_condition in condition.py to confirm the common-attribute matching and the no-shared-attributes rule, then edit reference/specs/query-algebra.md at §2.4 (line 103), §2.5 (line 124) and §8.3 (line 956). Also add the universal-aggregate example to reference/operators.md around line 258. Done means the matching rule is stated on common attributes with a link to §9, the empty-attribute rule has examples, and the universal-aggregate restriction is documented with the .make_subquery() workaround until datajoint-python#1580 is resolved.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
reference/specs/query-algebra.md leaves out two behaviors that the implementation defines, and misstates the matching rule for restriction by a query expression.
1. §2.5 states the matching rule as primary keys
Line 124: "Restrict to rows with matching primary keys in another expression." The implementation (condition.py, make_condition) matches on every namesake attribute the two expressions share, subject to the lineage check of semantic matching, not only on primary-key attributes.
Fix: state the rule as matching on common (homologous) attributes, and link §9 (Semantic Matching).
2. §2.5 omits restriction when the expressions share no attributes
§2.4 documents the dictionary case (line 103: "If NO keys match, condition evaluates to True"). The expression case is undocumented. The implementation treats it the same way (condition.py: "without common attributes, any non-empty set matches everything"):
A & Bwith no common attributes: all ofAifBis non-empty, none ifBis empty.A - Bwith no common attributes: none ofAifBis non-empty, all ifBis empty.
This is what makes a global gate possible, for example Table & (dj.U().aggr(Other, n="count(*)") & "n > 0").
Fix: add the rule to §2.5 with an example, next to the dictionary rule in §2.4.
3. §8.3 does not cover restricting a universal aggregate
§8.3 shows dj.U().aggr(Student, n='count(*)') returning one row, and line 956 says restrictions after aggregation go to HAVING or a subquery, but neither covers restricting an ungrouped aggregate (dj.U().aggr(T, n="count(*)") & "n = 3"). In v2.3.4 that raises an AssertionError (datajoint/datajoint-python#1580), and len() of the subquery workaround raises a SQL syntax error (datajoint/datajoint-python#1581).
Fix: once #1580 is resolved, add a §8.3 example that restricts a universal aggregate and uses it as a restriction (rule 2 above). Until then, note the .make_subquery() workaround. The "Universal Aggregation (Single Row Result)" section of reference/operators.md (line 258) could take the same example.
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 7
- Fork
- 12
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không 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 datajoint/datajoint-docs
-
documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
datajoint/datajoint-docs#301 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 52/100
datajoint/datajoint-docs#299 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
datajoint/datajoint-docs#298 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
datajoint/datajoint-docs#292 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của datajoint/datajoint-docs
Issue tương tự
-
[MOVIE]: Bedazzled (2000)Đang mởrequest-theme
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
LizardByte/ThemerrDB#8911 · 1 bình luận ·
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 84/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 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
accepted bug wg/agentic-context
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vllm-project/semantic-router#4922 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cancelled query leaves stale row index; next query on the connection returns leading empty slotsCó thể đã có người làm @pislm đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 7 ngày