json-type tutorial teaches client-side filtering as a property of JSON
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
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- jupyter-notebook, python
- Lĩnh vực
- documentation
Hướng nghiên cứu
This work is in src/tutorials/advanced/json-type.ipynb and is blocked on datajoint/datajoint-python#1564. After that issue merges, read the filtering reference added in #291, then update the “Filtering on JSON Content” section and Design Guidelines table. Re-execute the notebook so its committed outputs match, and cross-link the reference.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Blocked on datajoint/datajoint-python#1564. Deliberately deferred so the tutorial is not rewritten twice.
The problem
src/tutorials/advanced/json-type.ipynb is the page a user opens to learn how to work with JSON. Its filtering section reads:
Filtering on JSON Content
Fetch then filter in Python:
followed by pulling the whole table into a list comprehension:
calibrated = [
e for e in Equipment.to_dicts()
if e['specs'] and e['specs'].get('calibrated')
]
and its Design Guidelines table lists this as an inherent property of the type:
| JSON | Normalized Tables |
|---|---|
| Filter in Python | Filter in SQL |
Why it is wrong
Server-side filtering works, on both backends. Equipment & {"specs.vendor": "Acme"} is translated to json_value() on MySQL and jsonb_extract_path_text() on PostgreSQL; ordering comparisons work through a typed projection, proj(ch="specs.channels:unsigned") & "ch > 32". The syntax is documented in #291.
So the tutorial teaches a full table scan into Python for something the database does, and presents it as a limitation of JSON rather than a choice.
Why it probably says that
The tutorial's own example is specs.calibrated, a boolean — and & {"specs.calibrated": True} returns no rows on MySQL and raises on PostgreSQL (datajoint-python#1564). Whoever wrote the section likely tried exactly that, got nothing back, and concluded JSON cannot be filtered server-side.
That is why this waits: writing the section against the string workaround ({"specs.calibrated": "true"}) would teach an idiom that becomes wrong as soon as #1564 lands.
When #1564 merges
- Rewrite Filtering on JSON Content to filter server-side, keeping one short client-side example for genuinely non-SQL-expressible predicates.
- Correct the Design Guidelines table — "Filter in Python" is not a property of JSON. The honest contrast is about indexing and type enforcement, not about where filtering happens.
- Cross-link the reference section added in #291.
- Re-execute the notebook: these are code cells with committed outputs.
- 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 55/100
datajoint/datajoint-docs#300 ·
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
Tất cả issue của datajoint/datajoint-docs
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/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 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Frontmatter next to `src:` is applied to every imported slide, not only the first (undocumented)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[scanner] check:spelling skips blog/ — posts and author metadata are never spell-checkedCó thể đã có người làm @hivecommons-hive đã nhận hôm nay. Đang mởagent/scanner bug hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
cncf/endusers#1452 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
midnightntwrk/midnight-js#1482 ·
Maintainer thường phản hồi trong vòng 1 ngày