bigframes.pandas.read_pickle#
- bigframes.pandas.read_pickle(filepath_or_buffer: FilePath | ReadPickleBuffer, compression: CompressionOptions = 'infer', storage_options: StorageOptions = None, *, write_engine: constants.WriteEngineType = 'default')[source]#
Load pickled BigFrames object (or any object) from file.
Note
If the content of the pickle file is a Series and its name attribute is None, the name will be set to ‘0’ by default.
Note
Data is inlined in the query SQL if it is small enough (roughly 5MB or less in memory). Larger size data is loaded to a BigQuery table instead.
Examples:
>>> import bigframes.pandas as bpd
>>> gcs_path = "gs://bigframes-dev-testing/test_pickle.pkl" >>> df = bpd.read_pickle(filepath_or_buffer=gcs_path)
- Parameters:
filepath_or_buffer (str, path object, or file-like object) – String, path object (implementing os.PathLike[str]), or file-like object implementing a binary readlines() function. Also accepts URL. URL is not limited to S3 and GCS.
compression (str or dict, default 'infer') – For on-the-fly decompression of on-disk data. If ‘infer’ and ‘filepath_or_buffer’ is path-like, then detect compression from the following extensions: ‘.gz’, ‘.bz2’, ‘.zip’, ‘.xz’, ‘.zst’, ‘.tar’, ‘.tar.gz’, ‘.tar.xz’ or ‘.tar.bz2’ (otherwise no compression). If using ‘zip’ or ‘tar’, the ZIP file must contain only one data file to be read in. Set to None for no decompression. Can also be a dict with key ‘method’ set to one of {‘zip’, ‘gzip’, ‘bz2’, ‘zstd’, ‘tar’} and other key-value pairs are forwarded to zipfile.ZipFile, gzip.GzipFile, bz2.BZ2File, zstandard.ZstdDecompressor or tarfile.TarFile, respectively. As an example, the following could be passed for Zstandard decompression using a custom compression dictionary compression={‘method’: ‘zstd’, ‘dict_data’: my_compression_dict}.
storage_options (dict, default None) – Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc. For HTTP(S) URLs the key-value pairs are forwarded to urllib.request.Request as header options. For other URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are forwarded to fsspec.open. Please see fsspec and urllib for more details, and for more examples on storage options refer here.
write_engine (str) – How data should be written to BigQuery (if at all). See
bigframes.pandas.read_pandas()for a full description of supported values.
- Returns:
- same type as object
stored in file.
- Return type: