Local seed path containing a single quote breaks the DuckDB query
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #1109 di @xubenqiang — chiusa senza merge
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 67/100
Direzione di ricerca
Leggi packages/data-designer-engine/src/data_designer/engine/resources/seed_reader.py, concentrandoti su get_seed_dataset_size, get_column_names e su entrambi i rami di build_dataset_read_query. Per prima cosa controlla come ciascun metodo costruisce il proprio letterale SQL DuckDB e cerca i test esistenti del seed reader. Il lavoro è completato quando un percorso locale di seed contenente un apostrofo funziona per i nomi delle colonne, i conteggi delle righe e le letture del dataset; esegui i test pertinenti e aggiungi test per questo percorso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Priority Level
Low (Cosmetic / Minor)
Describe the bug
A local seed file whose path contains a single quote can't be read. SeedReader puts the dataset URI into DuckDB SQL as a quoted string literal without escaping it, so a ' anywhere in the path ends the literal early and DuckDB fails with a parser error. It happens with a directory like o'brien/ or anything under a home directory with an apostrophe in the user name.
The literal is built in four places in packages/data-designer-engine/src/data_designer/engine/resources/seed_reader.py on current main (4bb221eb). Those are get_seed_dataset_size (line 301), get_column_names (line 352) and both branches of build_dataset_read_query (lines 381 and 386), all in the form
f"SELECT COUNT(*) FROM '{self.get_dataset_uri()}'"
Steps/Code to reproduce bug
import os
import pandas as pd
import data_designer.config as dd
from data_designer.interface import DataDesigner
os.makedirs("o'brien", exist_ok=True)
pd.DataFrame({"name": ["a", "b"]}).to_parquet("o'brien/seed.parquet")
builder = dd.DataDesignerConfigBuilder()
builder.with_seed_dataset(dd.LocalFileSeedSource(path="o'brien/seed.parquet"))
builder.add_column(dd.ExpressionColumnConfig(name="greeting", expr="hi {{ name }}"))
result = DataDesigner(artifact_path="./artifacts").preview(builder, num_records=2)
print(result.dataset)
On main at 4bb221eb with Python 3.14 and duckdb 1.5.0 this gives (path shortened)
data_designer.interface.errors.DataDesignerGenerationError: 🛑 Error generating preview dataset: Parser Error: syntax error at or near "/"
LINE 1: ...o'brien/seed.parquet'
^
The same script with the directory renamed to obrien works.
Expected behavior
The seed should load the same as from any other path.
Agent Diagnostic / Prior Investigation
Calling LocalFileSeedReader directly shows both get_column_names() and get_seed_dataset_size() failing with the same ParserException, so it's not specific to preview. In DuckDB a ' inside a string literal is written as '', and with the path escaped that way SELECT COUNT(*) FROM '...o''brien/seed.parquet' and the DESCRIBE query both work. The other readers aren't affected in practice. DataFrameSeedReader and the filesystem readers use the fixed table name df, and HuggingFaceSeedReader builds hf:// paths from repo ids. I searched issues and PRs for quote, apostrophe, seed path and get_dataset_uri and didn't find this reported.
Additional context
The fix I'd suggest is a small helper in SeedReader that doubles single quotes when building the SQL literal, used in those four spots. get_dataset_uri() itself should keep returning the raw path, since get_storage_plan also uses it with Path and glob. Happy to send a PR with tests once it's triaged.
Checklist
- I reproduced this issue or provided a minimal example
- I searched the docs/issues myself, or had my agent do so
- If I used an agent, I included its diagnostics above
- Lingua principale
- Python
- Stelle
- 2.4k
- Fork
- 241
- Merge medio
- 1g 19m
- PR unite (30g)
- 84
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la 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 NVIDIA-NeMo/DataDesigner
-
Code validation repeats the first result for subsequent target columnsForse già presa @edjson l’ha presa 1 giorno fa. Apertabug triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
NVIDIA-NeMo/DataDesigner#1092 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enforce \from future import annotations` via ruff FA102 rule`Forse già presa @chethanuk l’ha presa 48 giorni fa. Apertatask
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NVIDIA-NeMo/DataDesigner#760 ·
I maintainer di solito rispondono entro 1 giorno
-
Complete Slurm proxy health integration, draining, telemetry, and overload validationForse già presa @nabinchha l’ha presa 1 giorno fa. Apertatask
NVIDIA-NeMo/DataDesigner#1103 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
task
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
NVIDIA-NeMo/DataDesigner#1094 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
NVIDIA-NeMo/DataDesigner#1088 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NVIDIA-NeMo/DataDesigner
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Graphify-Labs/graphify#4860 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
:bug: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
scikit-image/scikit-image#8377 ·
I maintainer di solito rispondono entro 1 giorno
-
Ingredient import validation accepts negative nutrient values and NaNForse già presa @LukeSekai l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
wger-project/wger#2564 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/ponymail-foal#351 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 4 giorni