@@ -458,26 +458,23 @@ end
458458 end
459459end
460460
461- @testitem " PyPandasDataFrame" begin
461+ @testitem " PyPandasDataFrame" setup = [Setup] begin
462462 using Tables
463463 @test PyPandasDataFrame isa Type
464- # TODO : figure out how to get pandas into the test environment
465- # for now use some dummy type and take advantage of the fact that the code doesn't actually check it's a real dataframe
466- @pyexec """
467- class DataFrame:
468- def __init__(self, **kw):
469- self.__dict__.update(kw)
470- """ => DataFrame
471- df = DataFrame (shape = (4 , 3 ), columns = pylist ([" foo" , " bar" , " baz" ]))
472- x = PyPandasDataFrame (df)
473- @test ispy (x)
474- @test Py (x) === df
475- @test Tables. istable (x)
476- @test Tables. columnaccess (x)
477- @test_throws Exception Tables. columns (x)
478- @test_throws Exception pyconvert (PyPandasDataFrame, 1 )
479- str = sprint (show, MIME (" text/plain" ), x)
480- @test occursin (r" 4×3 .*PyPandasDataFrame" , str)
464+ if Setup. devdeps
465+ pd = pyimport (" pandas" )
466+ df = pd. DataFrame (pydict (foo= pylist ([1 ,2 ,3 ,4 ]), bar= pylist ([2 ,3 ,4 ,5 ]), baz= pylist ([3 ,4 ,5 ,6 ])))
467+ x = PyPandasDataFrame (df)
468+ @test ispy (x)
469+ @test Py (x) === df
470+ @test Tables. istable (x)
471+ @test Tables. columnaccess (x)
472+ # TODO : test the tables interface more fully
473+ Tables. columns (x)
474+ @test_throws Exception pyconvert (PyPandasDataFrame, 1 )
475+ str = sprint (show, MIME (" text/plain" ), x)
476+ @test occursin (r" 4×3 .*PyPandasDataFrame" , str)
477+ end
481478end
482479
483480@testitem " PySet" begin
0 commit comments