Skip to content

Commit

Permalink
Change to streaming reader for CSV schema inference.
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkzinzow authored Oct 6, 2023
1 parent cdbcec4 commit dd3c677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions daft/table/schema_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def from_csv(
else:
fs = None
with _open_stream(file, fs) as f:
table = pacsv.read_csv(
reader = pacsv.open_csv(
f,
parse_options=pacsv.ParseOptions(
delimiter=csv_options.delimiter,
Expand All @@ -50,7 +50,7 @@ def from_csv(
),
)

return Table.from_arrow(table).schema()
return Schema.from_pyarrow_schema(reader.schema)


def from_json(
Expand Down

0 comments on commit dd3c677

Please sign in to comment.