json-type tutorial teaches client-side filtering as a property of JSON
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- jupyter-notebook, python
- Ambito
- documentation
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Jupyter Notebook
- Stelle
- 7
- Fork
- 12
- Merge medio
- 2g 19h
- PR unite (30g)
- 20
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di datajoint/datajoint-docs
-
documentation
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
datajoint/datajoint-docs#301 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
datajoint/datajoint-docs#300 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 52/100
datajoint/datajoint-docs#299 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
datajoint/datajoint-docs#298 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di datajoint/datajoint-docs
Issue simili
-
Docs: refresh target-app-parity and file-format-parity against mainForse già presa @vangel76 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
storytold/photocraft#4417 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
📖 docs: Docker Compose quick start doesn't mention editing the project values in src/hive.yamlApertadocumentation help wanted needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
hivecommons/hive#11606 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue launch
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
FlologixAI/etchwork#4 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
appsmithorg/appsmith-docs#3064 ·
I maintainer di solito rispondono entro 1 giorno
-
[docs] `/docs/identity-security/usage/alerts/`: docs reference a date that has already passedApertadocumentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
gravitational/teleport#69869 ·