json-type tutorial teaches client-side filtering as a property of JSON
Les mainteneurs répondent en général sous 4 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Documentation
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- jupyter-notebook, python
- Domaine
- documentation
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Jupyter Notebook
- Étoiles
- 7
- Forks
- 12
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 15
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de datajoint/datajoint-docs
-
documentation
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
datajoint/datajoint-docs#301 ·
Les mainteneurs répondent en général sous 4 jours
-
Difficulté 3/5 Une demi-journée Accessibilité débutants 55/100
datajoint/datajoint-docs#300 ·
Les mainteneurs répondent en général sous 4 jours
-
Difficulté 3/5 Une demi-journée Accessibilité débutants 52/100
datajoint/datajoint-docs#299 · 1 commentaire ·
Les mainteneurs répondent en général sous 4 jours
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
datajoint/datajoint-docs#298 ·
Les mainteneurs répondent en général sous 4 jours
Toutes les issues de datajoint/datajoint-docs
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
aws-samples/sample-per-model-bedrock#295 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
zephyrproject-rtos/reqmgmt#177 ·
-
docs(simulation): Quickstart publishes UDP 14550, which the SITL images' own docs say not to doOuvertestatus:needs-triage
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
PX4/PX4-Autopilot#29292 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 83/100
-
TSDAE's docstring implies a theta argument it does not takePeut-être pris @singhharsh1708 l’a pris aujourd’hui. Ouvertedocumentation
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
SciML/PETScDiffEq.jl#282 ·
Les mainteneurs répondent en général sous 1 jour