`read_json` accepts a list of paths at runtime but the type stub only allows a single path.
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- python
- Bereich
- developer-experience
Rechercherichtung
Beginne damit, den Python-Stub für con.read_json zu finden, und überprüfe die Annotation von path_or_buffer. Überprüfe die Reproduktion mit pyright und mypy; abgeschlossen ist die Aufgabe, wenn beide Typechecker Listen von JSON-Pfaden akzeptieren, während die bestehenden Formen mit einem einzelnen Pfad weiterhin gültig bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 189
- Forks
- 117
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 16
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus duckdb/duckdb-python
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
duckdb/duckdb-python#633 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
duckdb/duckdb-python#627 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
duckdb/duckdb-python#534 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
duckdb/duckdb-python#386 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
duckdb/duckdb-python#638 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in duckdb/duckdb-python
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
letsencrypt/cp-cps#353 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
DOI-USGS/pywatershed#421 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python-pillow/Pillow#10087 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag