Skip to content

Commit

Permalink
chore: use from_arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Oct 4, 2024
1 parent 11723c2 commit a051365
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py-polars/polars/io/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
from typing import TYPE_CHECKING, Any
from urllib.parse import urlparse

from polars.dataframe import DataFrame
from polars.convert import from_arrow
from polars.datatypes import Null, Time
from polars.datatypes.convert import unpack_dtypes
from polars.dependencies import _DELTALAKE_AVAILABLE, deltalake
from polars.io.parquet import scan_parquet
from polars.schema import Schema

if TYPE_CHECKING:
from polars import DataType, LazyFrame
from polars import DataFrame, DataType, LazyFrame


def read_delta(
Expand Down Expand Up @@ -275,7 +275,7 @@ def scan_delta(
raise DeltaProtocolError(msg)

delta_schema = dl_tbl.schema().to_pyarrow(as_large_types=True)
polars_schema = DataFrame(pa.Table.from_pylist([], delta_schema)).schema
polars_schema = from_arrow(pa.Table.from_pylist([], delta_schema)).schema # type: ignore
partition_columns = dl_tbl.metadata().partition_columns

def _split_schema(
Expand Down

0 comments on commit a051365

Please sign in to comment.