`read_json` accepts a list of paths at runtime but the type stub only allows a single path.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- developer-experience
Direzione di ricerca
Inizia individuando lo stub Python per con.read_json ed esamina l’annotazione di path_or_buffer. Verifica la riproduzione con pyright e mypy; il lavoro è completato quando entrambi i type checker accettano liste di percorsi JSON, mentre le forme esistenti con un singolo percorso rimangono valide.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens?
Hi duckdb team, big fan of the product!
I'm experiencing a small typing issue:
import duckdb
con = duckdb.connect()
rel = con.read_json(
["a.jsonl", "b.jsonl"],
format="newline_delimited",
)
print(rel.count("*").fetchone())
This runs fine and returns the union of both files.
However, pyright throws:
Argument of type "list[str]" cannot be assigned to parameter "path_or_buffer" of type "str | bytes | PathLike[str] | PathLike[bytes] | IO[bytes] | IO[str]"
mypy throws a similar error.
Adding list[str] (and probably list[PathLike]) to path_or_buffer in the Python stub would fix this
To Reproduce
import duckdb
con = duckdb.connect()
rel = con.read_json(
["a.jsonl", "b.jsonl"],
format="newline_delimited",
)
print(rel.count("*").fetchone())
OS:
macOS arm64
DuckDB Package Version:
1.5.3
Python Version:
3.10
Full Name:
Amir Refaee
Affiliation:
Railtracks
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Not applicable - the reproduction does not require a data set
Did you include all code required to reproduce the issue?
- Yes, I have
Did you include all relevant configuration to reproduce the issue?
- Yes, I have
- Lingua principale
- Python
- Stelle
- 186
- Fork
- 113
- Merge medio
- 20h 58m
- PR unite (30g)
- 11
Guida per i contributori
Apri 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 duckdb/duckdb-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
duckdb/duckdb-python#627 ·
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
duckdb/duckdb-python#534 ·
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
duckdb/duckdb-python#386 ·
-
needs triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
duckdb/duckdb-python#622 ·
-
needs triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
duckdb/duckdb-python#617 · 2 commenti ·
Tutte le issue di duckdb/duckdb-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100