def _persist(source, path, **kwargs):
        """Save dataframe to local persistent store

        Makes a parquet dataset out of the data using dask.dataframe.to_parquet.
        This then becomes a data entry in the persisted datasets catalog.

        Parameters
        ----------
        source: a DataSource instance to save
        name: str or None
            Key to refer to this persisted dataset by. If not given, will
            attempt to get from the source's name
        kwargs: passed on to dask.dataframe.to_parquet
        """
        try:
            from intake_parquet import ParquetSource
        except ImportError:
            raise ImportError("Please install intake-parquet to use persistence"
                              " on dataframe container sources.")
        try:
            df = source.to_dask()
        except NotImplementedError:
            import dask.dataframe as dd
            df = dd.from_pandas(source.read(), 1)
        df.to_parquet(path, **kwargs)
        source = ParquetSource(path, meta={})
        return source
def _persist ( source , path , ** kwargs ) : try : from intake_parquet import ParquetSource except ImportError : raise ImportError ( "Please install intake-parquet to use persistence" " on dataframe container sources." ) try : df = source . to_dask ( ) except NotImplementedError : import dask . dataframe as dd df = dd . from_pandas ( source . read ( ) , 1 ) df . to_parquet ( path , ** kwargs ) source = ParquetSource ( path , meta = { } ) return source
Save dataframe to local persistent store

        Makes a parquet dataset out of the data using dask.dataframe.to_parquet.
        This then becomes a data entry in the persisted datasets catalog.

        Parameters
        ----------
        source: a DataSource instance to save
        name: str or None
            Key to refer to this persisted dataset by. If not given, will
            attempt to get from the source's name
        kwargs: passed on to dask.dataframe.to_parquet