File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ def arrow(self) -> "pa.Table":
348
348
349
349
@property
350
350
def pl (self ) -> "pl.DataFrame" :
351
- return pl .DataFrame (self . dict )
351
+ return pl .DataFrame (dict ( self ) )
352
352
353
353
def is_dataset (self , key ):
354
354
attr = getattr (self , key , None )
Original file line number Diff line number Diff line change @@ -19,13 +19,9 @@ dependencies = [
19
19
20
20
[dependency-groups ]
21
21
dev = [
22
- " pytest>=8" ,
23
- ]
24
- polars = [
25
22
" polars>=1" ,
26
- ]
27
- pyarrow = [
28
23
" pyarrow>=17" ,
24
+ " pytest>=8" ,
29
25
]
30
26
31
27
[tool .hatch .build ]
Original file line number Diff line number Diff line change @@ -259,13 +259,15 @@ class aDataset(af.Dataset):
259
259
260
260
261
261
@pytest .mark .skipif (NO_POLARS , reason = "polars is not installed" )
262
+ @pytest .mark .skipif (NO_PYARROW , reason = "pyarrow is not installed" )
262
263
def test_to_polars ():
263
264
class aDataset (af .Dataset ):
264
265
v1 = af .VectorBool ("" )
265
266
v2 = af .VectorF32 ("" )
266
267
v3 = af .VectorI16 ("" )
267
268
268
269
data = aDataset (v1 = [True ], v2 = [1 / 2 ], v3 = [999 ])
270
+ # this requires polars AND pyarrow because conversion goes via pd.Series
269
271
polars_df = data .pl
270
272
assert str (polars_df .dtypes ) == "[Boolean, Float32, Int16]"
271
273
You can’t perform that action at this time.
0 commit comments