Skip to content

Module bastionlab.polars.client

Classes

BastionLabPolars()

Main BastionLabPolars API class.

This class contains all the endpoints allowed on the BastionLab server for Polars. It is instantiated by the bastionlab.Client class and is accessible through the bastionlab.Client.polars property.

Methods

RemoteArray(self, identifier: Optional[str] = None, reference: Optional[bastionlab_pb2.Reference] = None) ‑> bastionlab.polars.frame.RemoteArray :

get_df(self, identifier: str) ‑> FetchableLazyFrame

Returns a FetchableLazyFrame from an BastionLab DataFrame identifier.

Args: identifier (str): A unique identifier for the Remote DataFrame.

Returns: FetchableLazyFrame

list_dfs(self) ‑> List[FetchableLazyFrame]

Enlists all the DataFrames available on the BastionLab server.

Returns: List[FetchableLazyFrame]

send_df(self, df: polars.internals.dataframe.frame.DataFrame, policy: bastionlab.polars.policy.Policy = Policy(safe_zone=Aggregation(min_agg_size=10), unsafe_handling=Review(), savable=True), sanitized_columns: List[str] = []) ‑> FetchableLazyFrame

This method is used to send pl.DataFrame to the BastionLab server.

It readily accepts pl.DataFrame and also specifies the DataFrame policy and a list of sensitive columns.

Args: df (pl.DataFrame): Polars DataFrame policy (Policy, optional): BastionLab Remote DataFrame policy. This specifies which operations can be performed on DataFrames and they specified the data owner. sanitized_columns (List[str], optional): This field contains (sensitive) columns in the DataFrame that are to be removed when a Data Scientist wishes to fetch a query performed on the DataFrame.

Returns: FetchableLazyFrame