Skip to content

Commit

Permalink
ci(typing): Add pyarrow-stubs to dev dependencies
Browse files Browse the repository at this point in the history
Will put this in another PR, but need it here for IDE support
  • Loading branch information
dangotbanned committed Nov 8, 2024
1 parent 7d6c7ca commit 0bb4210
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ dev = [
"duckdb>=1.0",
"ipython[kernel]",
"pandas>=1.1.3",
"pyarrow-stubs",
"pytest",
"pytest-cov",
"pytest-xdist[psutil]~=3.5",
Expand Down
5 changes: 3 additions & 2 deletions tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,19 @@ def test_sanitize_pyarrow_table_columns() -> None:
)

# Create pyarrow table with explicit schema so that date32 type is preserved
# error: Argument 1 to "schema" has incompatible type "list[object]"; expected "Iterable[Field[Any]] | Iterable[tuple[str, DataType]] | Mapping[str, DataType]" [arg-type]
pa_table = pa.Table.from_pandas(
df,
pa.schema(
[
(
pa.field("s", pa.string()),
pa.field("f", pa.float64()),
pa.field("i", pa.int64()),
pa.field("b", pa.bool_()),
pa.field("d", pa.date32()),
pa.field("c", pa.dictionary(pa.int8(), pa.string())),
pa.field("p", pa.timestamp("ns", tz="UTC")),
]
)
),
)
sanitized = sanitize_narwhals_dataframe(nw.from_native(pa_table, eager_only=True))
Expand Down

0 comments on commit 0bb4210

Please sign in to comment.