bigframes._config.DisplayOptions#

class bigframes._config.DisplayOptions(max_columns: int = 20, max_rows: int = 10, precision: int = 6, progress_bar: str | None = 'auto', repr_mode: Literal['head', 'deferred', 'anywidget'] = 'head', max_colwidth: int | None = 50, max_info_columns: int = 100, max_info_rows: int | None = 200000, memory_usage: bool = True, blob_display: bool = True, blob_display_width: int | None = None, blob_display_height: int | None = None)[source]#

Encapsulates the configuration for displaying objects.

Examples:

Define Repr mode to “deferred” will prevent job execution in repr.

>>> import bigframes.pandas as bpd
>>> df = bpd.read_gbq("bigquery-public-data.ml_datasets.penguins")
>>> bpd.options.display.repr_mode = "deferred"
>>> df.head(20) # will no longer run the job
Computation deferred. Computation will process 28.9 kB

Users can also get a dry run of the job by accessing the query_job property before they’ve run the job. This will return a dry run instance of the job they can inspect.

>>> df.query_job.total_bytes_processed
28947

User can execute the job by calling .to_pandas()

>>> # df.to_pandas()

Reset repr_mode option

>>> bpd.options.display.repr_mode = "head"

Can also set the progress_bar option to see the progress bar in terminal,

>>> bpd.options.display.progress_bar = "terminal"

notebook,

>>> bpd.options.display.progress_bar = "notebook"

or just remove it.

Setting to default value “auto” will detect and show progress bar automatically.

>>> bpd.options.display.progress_bar = "auto"

Attributes

blob_display

If True, display the blob content in notebook DataFrame preview.

blob_display_height

Height in pixels that the blob constrained to.

blob_display_width

Width in pixels that the blob constrained to.

max_columns

Maximum number of columns to display.

max_colwidth

The maximum width in characters of a column in the repr.

max_info_columns

Used in DataFrame.info method to decide if information in each column will be printed.

max_info_rows

Limit null check in df.info() only to frames with smaller dimensions than max_info_rows.

max_rows

Maximum number of rows to display.

memory_usage

If True, memory usage of a DataFrame should be displayed when df.info() is called.

precision

Controls the floating point output precision.

progress_bar

Determines if progress bars are shown during job runs.

repr_mode

Determines how to display a DataFrame or Series.

Methods

__init__([max_columns, max_rows, precision, ...])