def test_store_zip_parquet_c(self) -> None: f1, f2 = get_test_framesB() config = StoreConfig( index_depth=1, include_index=True, index_constructors=IndexDate, columns_depth=1, include_columns=True, ) with temp_file('.zip') as fp: st = StoreZipParquet(fp) st.write(((f.name, f) for f in (f1, f2)), config=config) post = tuple( st.read_many( ('a', 'b'), container_type=Frame, config=config, )) self.assertIs(post[0].index.__class__, IndexDate) self.assertIs(post[1].index.__class__, IndexDate)
def test_store_zip_parquet_a(self) -> None: f1, f2, f3 = get_test_framesA() with temp_file('.zip') as fp: for read_max_workers in (1, 2): config = StoreConfig(index_depth=1, include_index=True, columns_depth=1, read_max_workers=read_max_workers) st = StoreZipParquet(fp) st.write((f.name, f) for f in (f1, f2, f3)) f1_post = st.read('foo', config=config) self.assertTrue( f1.equals(f1_post, compare_name=True, compare_class=True)) f2_post = st.read('bar', config=config) self.assertTrue( f2.equals(f2_post, compare_name=True, compare_class=True)) f3_post = st.read('baz', config=config) self.assertTrue( f3.equals(f3_post, compare_name=True, compare_class=True))
def to_zip_parquet(self, fp: PathSpecifier, config: StoreConfigMapInitializer = None) -> None: ''' Write the complete :obj:`Bus` as a zipped archive of parquet files. {args} ''' store = StoreZipParquet(fp) config = config if not config is None else self._config store.write(self.items(), config=config)
def to_zip_parquet(self, fp: PathSpecifier, *, config: StoreConfigMapInitializer = None) -> None: ''' Write the complete :obj:`Bus` as a zipped archive of parquet files. {args} ''' store = StoreZipParquet(fp) config = self._filter_config(config) store.write(self._items_store(), config=config)
def test_store_zip_parquet_b(self) -> None: f1, f2, f3 = get_test_framesA() with temp_file('.zip') as fp: for read_max_workers in (1, 2): config = StoreConfig(index_depth=1, include_index=True, columns_depth=1, read_max_workers=read_max_workers) st = StoreZipParquet(fp) st.write((f.name, f) for f in (f1, f2, f3)) post = tuple(st.read_many(('baz', 'bar', 'foo'), config=config)) self.assertEqual(len(post), 3) self.assertEqual(post[0].name, 'baz') self.assertEqual(post[1].name, 'bar') self.assertEqual(post[2].name, 'foo')