json-type tutorial teaches client-side filtering as a property of JSON
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- jupyter-notebook, python
- Área
- documentation
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 7
- Forks
- 12
- Merge medio
- 2 d 19 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de datajoint/datajoint-docs
-
documentation
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
datajoint/datajoint-docs#301 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
datajoint/datajoint-docs#300 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 Medio día Aptitud para principiantes 52/100
datajoint/datajoint-docs#299 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
datajoint/datajoint-docs#298 ·
Los mantenedores suelen responder en 3 días
Todos los issues de datajoint/datajoint-docs
Issues similares
-
docs help wanted
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
-
Write a support policyAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
MattA-Official/vwmcp#20 ·
-
Fix the no-pin ruling in line-drawings: pin a below-the-record stage at the record's chapterAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
cosimochellini/one-piece-zero-spoiler#551 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
undergroundrap/hatchling#15 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Albert-Weasker/niubigeo#205 ·
Los mantenedores suelen responder en 1 día