Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

json-type tutorial teaches client-side filtering as a property of JSON

オープン
#292 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
jupyter-notebook, python
領域
documentation

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

documentation

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

  1. Rewrite Filtering on JSON Content to filter server-side, keeping one short client-side example for genuinely non-SQL-expressible predicates.
  2. 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.
  3. Cross-link the reference section added in #291.
  4. Re-execute the notebook: these are code cells with committed outputs.
主要言語
Jupyter Notebook
スター
7
フォーク
12
平均マージ
2日 19時間
マージ済み PR(30日)
20

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

datajoint/datajoint-docs のほかの issue

datajoint/datajoint-docs の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。