Document that NaN in a data variable is read as SQL NULL
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- documentation
Línea de trabajo
Empieza por revisar la conversión en xarray_sql/df.py y los dialectos ADBC; después, consulta docs/limitations.md y la documentación sobre lectura para encontrar el mejor lugar para esta nota. Documenta que NaN en una variable de datos se convierte en SQL NULL, que las funciones de agregación lo omiten y que no hay forma de leerlo como un valor NaN.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
xarray-sql turns NaN in a data variable into SQL NULL when it scans a Dataset (pa.array(..., from_pandas=True) in xarray_sql/df.py, and the same in the ADBC dialects). That is deliberate, so aggregates skip missing values the way xarray's skipna does. I couldn't find it in the user docs, though, and it surprised me.
What I expected
That a float NaN stays NaN, as it does in a Parquet file or an Arrow table registered directly, and that SUM over a column with a NaN returns NaN.
What happens
import numpy as np, xarray as xr, xarray_sql as xql
ds = xr.Dataset({"x": (("t",), [1.0, np.nan, 2.0])}, coords={"t": [0, 1, 2]})
ctx = xql.Context()
ctx.from_dataset("v", ds)
ctx.sql("SELECT SUM(x) AS s, COUNT(x) AS n, COUNT(*) AS rows FROM v").to_pandas()
# s = 3.0, n = 2, rows = 3
isnan(x) on that row is NULL, not true, and DuckDB through xql.register behaves the same.
Where it mattered
A check that attention masks pairs out rather than weighting them by zero put a NaN in V and expected it to reach only the queries allowed to see it. Every output stayed finite, because the NaN had become a NULL that SUM skipped. The check uses +inf instead, which xarray-sql keeps as a value.
Suggestion
Document it, for example in docs/limitations.md or the reading docs: NaN in a data variable is read as NULL; aggregates skip it; there's no way to read a NaN as a value. Whether to offer an option to keep NaN is a separate question.
- Lenguaje dominante
- Python
- Estrellas
- 142
- Forks
- 19
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 9
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 xqlsystems/xarray-sql
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
xqlsystems/xarray-sql#267 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
xqlsystems/xarray-sql#243 ·
Los mantenedores suelen responder en 1 día
-
publish.yml: the TestPyPI verification step is unreachable (and installs the wrong package name)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
xqlsystems/xarray-sql#242 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
xqlsystems/xarray-sql#237 ·
Los mantenedores suelen responder en 1 día
-
page not found errorAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
xqlsystems/xarray-sql#231 ·
Los mantenedores suelen responder en 1 día
Todos los issues de xqlsystems/xarray-sql
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
SACGF/variantgrid#2341 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
comp/cli P3 type/security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
NousResearch/hermes-agent#141420 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
CKV_GCP_18 (GKEPublicControlPlane) passes when master_authorized_networks_config is absent, control plane is internet-reachablePosiblemente ocupada @Varshith-Kali la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bridgecrewio/checkov#7753 ·
Los mantenedores suelen responder en 1 día