def test_from_castra_with_selection():
 castra = pytest.importorskip('castra')
 blosc = pytest.importorskip('blosc')
 if ((LooseVersion(blosc.__version__) == '1.3.0') or (LooseVersion(castra.__version__) < '0.1.8')):
  pytest.skip()
 df = pd.DataFrame({'x': ['a', 'b', 'c', 'd'], 'y': [2, 3, 4, 5]}, index=pd.Index([1.0, 2.0, 3.0, 4.0], name='ind'))
 a = dd.from_pandas(df, 2)
 b = dd.from_castra(a.to_castra())
 assert_eq(b[(b.y > 3)].x, df[(df.y > 3)].x)

def test_from_castra_with_selection ( ) : castra = pytest . importorskip ( 'castra' ) blosc = pytest . importorskip ( 'blosc' ) if ( ( LooseVersion ( blosc . __version__ ) == '1.3.0' ) or ( LooseVersion ( castra . __version__ ) < '0.1.8' ) ) : pytest . skip ( ) df = pd . DataFrame ( { 'x' : [ 'a' , 'b' , 'c' , 'd' ] , 'y' : [ 2 , 3 , 4 , 5 ] } , index = pd . Index ( [ 1.0 , 2.0 , 3.0 , 4.0 ] , name = 'ind' ) ) a = dd . from_pandas ( df , 2 ) b = dd . from_castra ( a . to_castra ( ) ) assert_eq ( b [ ( b . y > 3 ) ] . x , df [ ( df . y > 3 ) ] . x )
optimizations fuse getitems with load_partitions we used to use getitem for both column access and selections .