Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dataframely/columns/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def sqlalchemy_dtype(self, dialect: sa.Dialect) -> sa_TypeEngine:

@property
def pyarrow_dtype(self) -> pa.DataType:
if len(self.categories) <= 2**8 - 2:
if len(self.categories) <= 2**8 - 1:
dtype = pa.uint8()
elif len(self.categories) <= 2**16 - 2:
elif len(self.categories) <= 2**16 - 1:
dtype = pa.uint16()
else:
dtype = pa.uint32()
Expand Down
4 changes: 2 additions & 2 deletions dataframely/filter_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import IO, TYPE_CHECKING, Any, Generic, TypeVar

import polars as pl
from polars._typing import PartitioningScheme
from polars.io.partition import _SinkDirectory as SinkDirectory

from dataframely._base_schema import BaseSchema
from dataframely._compat import deltalake
Expand Down Expand Up @@ -164,7 +164,7 @@ def write_parquet(self, file: str | Path | IO[bytes], **kwargs: Any) -> None:
self._write(ParquetStorageBackend(), file=file, **kwargs)

def sink_parquet(
self, file: str | Path | IO[bytes] | PartitioningScheme, **kwargs: Any
self, file: str | Path | IO[bytes] | SinkDirectory, **kwargs: Any
) -> None:
"""Stream the failure info to a single parquet file.

Expand Down
5 changes: 3 additions & 2 deletions dataframely/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

import polars as pl
import polars.exceptions as plexc
from polars._typing import FileSource, PartitioningScheme
from polars._typing import FileSource
from polars.io.partition import _SinkDirectory as SinkDirectory

from dataframely._compat import deltalake

Expand Down Expand Up @@ -861,7 +862,7 @@ def sink_parquet(
cls,
lf: LazyFrame[Self],
/,
file: str | Path | IO[bytes] | PartitioningScheme,
file: str | Path | IO[bytes] | SinkDirectory,
**kwargs: Any,
) -> None:
"""Stream a typed lazy frame with this schema to a parquet file.
Expand Down
Loading
Loading