Skip to main content
Version: 0.9.6

tabsdata

AWSGlue
AWSGlue.to_dict
AzureAccountKeyCredentialsCredentials class to store the credentials needed to access an Azure using account key credentials (account name and account key).
AzureAccountKeyCredentials.to_dictConvert the S3AccessKeyCredentials object to a dictionary.
AzureDestinationClass for managing the configuration of Azure-file-based data outputs.
AzureDestination.to_dictConverts the AzureDestination object to a dictionary with all the relevant information.
AzureSourceClass for managing the configuration of Azure-file-based data inputs.
AzureSource.to_dictConverts the AzureSource object to a dictionary with all the relevant information.
CollectionThis class represents a collection in the TabsdataServer.
Collection.create
Collection.delete
Collection.get_function
Collection.get_table
Collection.get_tablesList the tables in a collection.
Collection.refresh
Collection.register_functionCreate a function in the server.
Collection.update
Collection.update_functionUpdate a function in the server.
CommitThis class represents a commit in the TabsdataServer.
concatCombine multiple TableFrames by stacking their rows.
CSVFormatThe class of the CSV file format.
CSVFormat.to_dictReturns the dictionary representation of the object.
DataVersionThis class represents a data version of a table in the TabsdataServer.
DataVersion.get_worker
DestinationPluginAbstract class for output plugins.
DestinationPlugin.chunkTrigger the exporting of the data to local parquet chunks.
DestinationPlugin.streamTrigger the exporting of the data.
DestinationPlugin.to_dictReturn a dictionary representation of the object.
DestinationPlugin.writeGiven a file or a list of files, write to the desired destination.
EnvironmentSecretSecrets class representing a secret obtained from an environment variable in the server.
EnvironmentSecret.to_dictConvert the EnvironmentSecret object to a dictionary.
ExecutionPlanThis class represents an execution plan in the TabsdataServer.
ExecutionPlan.get_worker
ExecutionPlan.refresh
Expr
Expr.absReturn the abso lute value of the expression.
Expr.addEquivalent to the + operator.
Expr.aliasSet the name for a column or expression.
Expr.and_Bitwise and operator with the given expressions.
Expr.arccosCalculate the inverse cosine of the element value.
Expr.arccoshCalculate the inverse hyperbolic cosine of the element value.
Expr.arcsinCalculate the inverse sine of the element value.
Expr.arcsinhCalculate the inverse hyperbolic sine of the element value.
Expr.arctanCalculate the inverse tangent of the element value.
Expr.arctanhCalculate the inverse hyperbolic tangent of the element value.
Expr.castCast a value to d different type.
Expr.cbrtCalculate the cub root of the element value.
Expr.ceilRound up the expression to the next integer value.
Expr.clipFor element values outside the lower and upper bounds, lower values are replaced with the lower bound and upper values with the upper bound.
Expr.cosCalculate the cosine of the element value.
Expr.coshCalculate the hyperbolic cosine of the element value.
Expr.cotCalculate the cotangent of the element value.
Expr.countAggregation operation that counts the non null values of the given column in the group.
Expr.degreesConvert a radian value to degrees
Expr.diffCompute the difference between an element value and the element value of the specified relative row.
Expr.eqCompare if 2 expressions are equal, equivalent to expr == other.
Expr.eq_missingCompare if 2 expressions are equal an, equivalent to expr == other.
Expr.expCalculate the exponential of the element value.
Expr.fill_nanReplace NaN values with the given value.
Expr.fill_nullReplace null values with the given value.
Expr.filterApply a filter predicate to an expression.
Expr.firstGet the first element.
Expr.floorRound down the expression to the previous integer value.
Expr.floordivCalculate the floor on the division.
Expr.geGreater or equal operator.
Expr.gtGreater than operator.
Expr.hashCompute the hash of an element value.
Expr.is_betweenIf an expression is between the given bounds.
Expr.is_finiteIf an element value is finite.
Expr.is_inIf an element value is in the given collection.
Expr.is_infiniteIf an element value is infinite.
Expr.is_nanIf an element value is NaN.
Expr.is_not_nanIf an element value is not NaN.
Expr.is_not_nullIf an element value is not null (None).
Expr.is_nullIf an element value is null (None).
Expr.is_uniqueIf an element value is unique for all values in the column.
Expr.lastGet the last element.
Expr.leLess or equal operator.
Expr.lenAggregation operation that counts the rows in the group.
Expr.logCalculate the logarithm to the given base.
Expr.log10Calculate the logarithm base 10.
Expr.log1pCalculate the natural logarithm plus one.
Expr.ltLess than operator.
Expr.maxAggregation operation that finds the maximum value in the group.
Expr.meanAggregation operation that finds the mean of the values in the group.
Expr.medianAggregation operation that finds the median of the values in the group.
Expr.minAggregation operation that finds the minimum value in the group.
Expr.modModulus operator.
Expr.mulMultiplication operator.
Expr.n_uniqueAggregation operation that counts the unique values of the given column in the group.
Expr.neCompare if 2 expressions are not equal, equivalent to expr != other.
Expr.ne_missingCompare if 2 expressions are not equal an, equivalent to expr != other.
Expr.negUnary minus operator.
Expr.not_Negate a boolean expression.
Expr.or_Bitwise or operator with the given expressions.
Expr.powExponentiation operator.
Expr.radiansConvert a degree value to radians
Expr.rankCompute the rank of the element values.
Expr.reinterpretReinterpret the 64bit element values (i64 or u64) as a signed/unsigned integers.
Expr.roundRound floating point element values.
Expr.round_sig_figsRound floating point element values to the specified significant figures.
Expr.shrink_dtypeCast down a column to the smallest type that can hold the element values.
Expr.signCalculate the sign of element values.
Expr.sinCalculate the sine of the element value.
Expr.sinhCalculate the hyperbolic sine of the element value.
Expr.sliceCompute a slice of the TableFrame for the specified columns.
Expr.sqrtCalculate the square root of the element value.
Expr.subEquivalent to the - operator.
Expr.sumAggregation operation that sums the values in the group.
Expr.tanCalculate the tangent of the element value.
Expr.tanhCalculate the hyperbolic tangent of the element value.
Expr.truedivEquivalent to the float / operator.
Expr.xorBitwise xor operator with the given expression.
HashiCorpSecretSecrets class representing a secret stored in Hashicorp Vault.
HashiCorpSecret.to_dictConvert the HashiCorpSecret object to a dictionary.
litExpression for the given literal value.
LocalFileDestinationAbstract base class for managing data output configurations.
LocalFileDestination.to_dictConverts the LocalFileDestination object to a dictionary with all the relevant information.
LocalFileSourceClass for managing the configuration of local-file-based data inputs.
LocalFileSource.to_dictConverts the LocalFileSource object to a dictionary with all the relevant information.
LogFormatThe class of the log file format.
LogFormat.to_dictReturns the dictionary representation of the object.
MariaDBDestinationClass for managing the configuration of MariaDB-based data outputs.
MariaDBDestination.to_dictConverts the MariaDBDestination object to a dictionary with all the relevant information.
MariaDBSourceClass for managing the configuration of MariaDB-based data inputs.
MariaDBSource.to_dictConverts the MariaDBSource object to a dictionary with all the relevant information.
MongoDBDestinationAbstract class for output plugins.
MongoDBDestination.chunkTrigger the exporting of the data to local parquet chunks.
MongoDBDestination.streamTrigger the exporting of the data.
MongoDBDestination.writeThis method is used to write the files to the database.
MySQLDestinationClass for managing the configuration of MySQL-based data outputs.
MySQLDestination.to_dictConverts the MySQLDestination object to a dictionary with all the relevant information.
MySQLSourceClass for managing the configuration of MySQL-based data inputs.
MySQLSource.to_dictConverts the MySQLSource object to a dictionary with all the relevant information.
NDJSONFormatThe class of the log file format.
NDJSONFormat.to_dictReturns the dictionary representation of the object.
OracleDestinationClass for managing the configuration of Oracle-based data outputs.
OracleDestination.to_dictConverts the OracleDestination object to a dictionary with all the relevant information.
OracleSourceClass for managing the configuration of Oracle-based data inputs.
OracleSource.to_dictConverts the OracleSource object to a dictionary with all the relevant information.
ParquetFormatThe class of the Parquet file format.
ParquetFormat.to_dictReturns the dictionary representation of the object.
PostgresDestinationClass for managing the configuration of Postgres-based data outputs.
PostgresDestination.to_dictConverts the PostgresDestination object to a dictionary with all the relevant information.
PostgresSourceClass for managing the configuration of Postgres-based data inputs.
PostgresSource.to_dictConverts the PostgresSource object to a dictionary with all the relevant information.
publisherDecorator to set the data and destination parameters of a function and convert it to a TabsdataFunction.
S3AccessKeyCredentialsCredentials class to store the credentials needed to access an S3 bucket using access key credentials (access key id and secret access key).
S3AccessKeyCredentials.to_dictConvert the S3AccessKeyCredentials object to a dictionary.
S3DestinationClass for managing the configuration of S3-file-based data outputs.
S3Destination.to_dictConverts the S3Destination object to a dictionary with all the relevant information.
S3SourceClass for managing the configuration of S3-file-based data inputs.
S3Source.to_dictConverts the S3Source object to a dictionary with all the relevant information.
SalesforceSourceParent class for input plugins.
SalesforceSource.chunkTrigger the import of the data.
SourcePluginParent class for input plugins.
SourcePlugin.chunkTrigger the import of the data.
SourcePlugin.stream
SourcePlugin.to_dictReturn a dictionary representation of the object.
subscriberDecorator to set the data and destination parameters of a function and convert it to a TabsdataFunction.
TableFrameOwned Functions.
TableFrame.castCast columns to a new data type.
TableFrame.clearClears all rows of the TableFrame preserving the schema.
TableFrame.columns
TableFrame.dropDiscard columns from the TableFrame.
TableFrame.drop_nansDrop rows with NaN values.
TableFrame.drop_nullsDrop rows with null values.
TableFrame.empty
TableFrame.fill_nanReplace all NaN values in the TableFrame with the given value.
TableFrame.fill_nullReplace all null values in the TableFrame with the given value.
TableFrame.filterFilter the TableFrame based on the given predicates.
TableFrame.firstReturn a TableFrame with the first row.
TableFrame.group_byPerform a group by on the TableFrame.
TableFrame.headReturn a TableFrame with the first n rows.
TableFrame.itemReturns a scalar value if the TableFrame contains exactly one user column and one row.
TableFrame.joinJoin the TableFrame with another TableFrame.
TableFrame.lastReturn a TableFrame with the last row.
TableFrame.limitReturn a TableFrame with the first n rows.
TableFrame.renameRename columns from the TableFrame.
TableFrame.selectSelect column(s) from the TableFrame.
TableFrame.sliceReturn a TableFrame with a slice of the original TableFrame
TableFrame.sortSort the TableFrame by the given column(s) or expression(s).
TableFrame.tailReturn a TableFrame with the last n rows.
TableFrame.uniqueDeduplicate rows from the TableFrame.
TableFrame.with_columnsAdd columns to the TableFrame.
TableInputClass for managing the configuration of table-based data inputs.
TableInput.to_dictConverts the TableInput object to a dictionary with all the relevant information.
TableOutputClass for managing the configuration of table-based data outputs.
TableOutput.to_dictConverts the TableOutput object to a dictionary with all the relevant information.
TableURIURI class to represent a Tabs Data URI.
TableURI.to_stringReturn the URI as a string.
TabsdataFunctionClass to decorate a function with metadata and methods for use in a Tabsdata environment.
TabsdataServerThis class represents the TabsdataServer.
TabsdataServer.collection_createCreate a collection in the server.
TabsdataServer.collection_deleteDelete a collection in the server.
TabsdataServer.collection_getGet a collection in the server.
TabsdataServer.collection_list_functionsList the functions in a collection.
TabsdataServer.collection_updateUpdate a collection in the server.
TabsdataServer.dataversion_listList the data versions of a function in a collection.
TabsdataServer.execution_plan_readRead the execution plan in the server.
TabsdataServer.function_createCreate a function in the server.
TabsdataServer.function_deleteDelete a function in the server.
TabsdataServer.function_getGet a function in the server.
TabsdataServer.function_list_historyList the version history of a function.
TabsdataServer.function_triggerTrigger a function in the server.
TabsdataServer.function_updateUpdate a function in the server.
TabsdataServer.table_downloadDownload a table for a given version as a parquet file.
TabsdataServer.table_get_schemaGet the schema of a table for a given version.
TabsdataServer.table_listList the tables in a collection.
TabsdataServer.table_sampleGet a sample of a table for a given version as a parquet file.
TabsdataServer.transaction_cancelCancel an execution plan.
TabsdataServer.transaction_recoverRecover an execution plan.
TabsdataServer.user_createCreate a user in the server.
TabsdataServer.user_deleteDelete a user in the server.
TabsdataServer.user_getGet a user in the server.
TabsdataServer.user_updateUpdate a user in the server.
TabsdataServer.worker_list
TabsdataServer.worker_logGet the logs of a worker in the server.
transformerDecorator to set the data and destination parameters of a function and convert it to a TabsdataFunction.
UserThis class represents a user in the TabsdataServer.
User.create
User.delete
User.refresh
User.update
UserPasswordCredentialsCredentials class to store a user and password pair.
UserPasswordCredentials.to_dictConvert the UserPasswordCredentials object to a dictionary.

Collection

class Collection(
connection: APIServer,
name: str,
description: str | None = None,
**kwargs,
)

This class represents a collection in the TabsdataServer.

Parameters:

parameter
Attributes

created_on_string (str): The timestamp when the collection was created as a string.

Initialize the Collection object.

Parameters:

parameter
connectionAPIServer

The connection to the server.

parameter
namestr

The name of the collection.

parameter
**kwargs

Additional keyword arguments.

property
created_bystr

property
created_onint

property
created_on_stringstr

property
descriptionstr

property
functionsList[Function]

property
tablesList[Table]

create
def create(raise_for_status: bool = True) -> Collection

delete
def delete(raise_for_status: bool = True)

get_function
def get_function(function_name: str) -> Function

get_table
def get_table(table_name: str) -> Table | None

get_tables
def get_tables(offset: int = None, len: int = None) -> List[Table]

List the tables in a collection.

Parameters:

parameter
offsetint, optional

The offset of the list.

parameter
lenint, optional

The length of the list.

Returns:

List[Table]: The requested list of tables in the collection.

refresh
def refresh() -> Collection

register_function
def register_function(
function_path: str,
description: str = None,
path_to_bundle: str = None,
requirements: str = None,
local_packages: List[str] | str | None = None,
function_name: str = None,
raise_for_status: bool = True,
) -> Function

Create a function in the server.

Parameters:

parameter
function_pathstr

The path to the function. It should be in the form of /path/to/file.py::function_name.

parameter
descriptionstr, optional

The description of the function.

parameter
path_to_bundlestr, optional

The path that has to be bundled and sent to the server. If None, the folder containing the function will be bundled.

parameter
requirementsstr, optional

Path to a custom requirements.yaml file with the packages, python version and other information needed to create the Python environment for the function to run in the backend. If not provided, this information will be inferred from the current execution session.

parameter
local_packagesList[str] | str, optional

A list of paths to local Python packages that need to be included in the bundle. Each path must exist and be a valid Python package that can be installed by running pip install /path/to/package.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the function could not be created.

update
def update(
name: str,
description: str = None,
raise_for_status: bool = True,
) -> Collection

update_function
def update_function(
function_name: str,
function_path: str,
description: str,
directory_to_bundle: str = None,
requirements: str = None,
local_packages: List[str] | str | None = None,
new_function_name = None,
raise_for_status: bool = True,
) -> Function

Update a function in the server.

Parameters:

parameter
function_namestr

The name of the function.

parameter
function_pathstr

The path to the function. It should be in the form of /path/to/file.py::function_name.

parameter
descriptionstr

The new description of the function.

parameter
directory_to_bundlestr, optional

The path that has to be bundled and sent to the server. If None, the folder containing the function will be bundled.

parameter
requirementsstr, optional

Path to a custom requirements.yaml file with the packages, python version and other information needed to create the Python environment for the function to run in the backend. If not provided, this information will be inferred from the current execution session.

parameter
local_packagesList[str] | str, optional

A list of paths to local Python packages that need to be included in the bundle. Each path must exist and be a valid Python package that can be installed by running pip install /path/to/package.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the function could not be updated.


Commit

class Commit(
id: str,
execution_plan_id: str,
transaction_id: str,
triggered_on: int,
ended_on: int,
started_on: int,
**kwargs,
)

This class represents a commit in the TabsdataServer.

Parameters:

parameter
Attributes

triggered_on_str (str): The timestamp when the commit was triggered as a string. ended_on_str (str): The timestamp when the commit ended as a string. started_on_str (str): The timestamp when the commit started as a string.


DataVersion

class DataVersion(
connection: APIServer,
id: str,
collection: str | Collection,
function: str | Function,
**kwargs,
)

This class represents a data version of a table in the TabsdataServer.

Parameters:

parameter
idstr

The ID of the data version.

parameter
execution_plan_idstr

The ID of the execution plan.

parameter
triggered_onint

The timestamp when the data version was triggered.

parameter
statusstr

The status of the data version.

parameter
function_idstr

The ID of the function.

parameter
**kwargs

Additional keyword arguments.

Initialize the DataVersion object.

Parameters:

parameter
idstr

The ID of the data version.

parameter
execution_plan_idstr

The ID of the execution plan.

parameter
triggered_onint

The timestamp when the data version was triggered.

parameter
statusstr

The status of the data version.

parameter
function_idstr

The ID of the function.

parameter
**kwargs

Additional keyword arguments.

property
collectionCollection

property
execution_planExecutionPlan

property
functionFunction

property
workers

get_worker
def get_worker(worker_id: str)

ExecutionPlan

class ExecutionPlan(connection: APIServer, id: str, **kwargs)

This class represents an execution plan in the TabsdataServer.

Parameters:

parameter
Attributes

triggered_on_str (str): The timestamp when the execution plan was triggered as a string. ended_on_str (str): The timestamp when the execution plan ended as a string. started_on_str (str): The timestamp when the execution plan started as a string.

Initialize the ExecutionPlan object.

Parameters:

parameter
idstr

The id of the execution plan.

parameter
namestr

The name of the execution plan.

parameter
collectionstr

The collection where the execution plan is running.

parameter
datasetstr

The dataset where the execution plan is running.

parameter
triggered_bystr

The user that triggered the execution plan.

parameter
triggered_onint

The timestamp when the execution plan was triggered.

parameter
ended_onint

The timestamp when the execution plan ended.

parameter
started_onint

The timestamp when the execution plan started.

parameter
statusstr

The status of the execution plan.

parameter
**kwargs

Additional keyword arguments.

property
collectionCollection

property
dotstr

property
ended_onint

property
ended_on_strstr

property
functionFunction | None

property
namestr

property
started_onint

property
started_on_strstr

property
statusstr

property
triggered_bystr

property
triggered_onint

property
triggered_on_strstr

property
workers

get_worker
def get_worker(worker_id: str)

refresh
def refresh() -> ExecutionPlan

Expr

class Expr(expr: Expr | Expr)

property
dtExprDateTimeNameSpace

Return an object namespace with all date-time methods for a date-time value.

property
strExprStringNameSpace

Return an object namespace with all string methods for a string value.

floordiv
def floordiv(other: Any) -> Expr

Calculate the floor on the division.

Parameters:

parameter
other

The value to divide by.

Example:

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf = tf.select(td.col("temp"), td.col("temp").floordiv(2)
>>> .alias("floordiv"))
>>>
┌──────┬──────────┐
│ temp ┆ floordiv │
----------
│ f64 ┆ i64 │
╞══════╪══════════╡
2.51
1.40
└──────┴──────────┘

TableURI

class TableURI(
collection: str | None = None,
table: str = None,
version: str | Version | VersionList | VersionRange | None = None,
)

URI class to represent a Tabs Data URI. The URI is composed of a collection, a table and a version. The URI is represented as collection/table@version or table@version. The collection and table are optional, but at least one of them must be present. The version is optional. The collection and table must be strings. The version can be a string, a Version object, a VersionList object or a VersionRange object.

Attributes: collection (str): The collection of the URI. table (str): The table of the URI. version (Version | VersionList | VersionRange | None): The version of the URI.

Methods: to_string() -> str: Return the URI as a string.

Initialize the URI object.

Parameters:

parameter
collectionstr | None

The collection of the URI.

parameter
tablestr | None

The table of the URI.

parameter
versionstr | Version | VersionList | VersionRange | None

The version of the URI. If it is a string, it can be a single version, a list of versions separated by commas or a range of versions separated by two dots. If it is a Version, VersionList or VersionRange object, it will be used as is.

property
collectionstr

The collection of the URI.

property
tablestr

The table of the URI.

property
versionVersion | VersionList | VersionRange | None

The version(s) of the URI.

to_string
def to_string() -> str

Return the URI as a string.

Returns:

str: The URI as a string.


TabsdataServer

class TabsdataServer(url: str, username: str, password: str)

This class represents the TabsdataServer.

Parameters:

parameter
urlstr

The url of the server.

parameter
usernamestr

The username of the user.

parameter
passwordstr

The password of the user.

Initialize the TabsdataServer object.

Parameters:

parameter
urlstr

The url of the server.

parameter
usernamestr

The username of the user.

parameter
passwordstr

The password of the user.

property
collectionsList[Collection]

Get the list of collections in the server. This list is obtained every time the property is accessed, so sequential accesses to this property in the same object might yield different results.

Returns: List[Collection]: The list of collections in the server.

property
commitsList[Commit]

Get the list of commits in the server. This list is obtained every time the property is accessed, so sequential accesses to this property in the same object might yield different results.

Returns: List[Transaction]: The list of commits in the server.

property
execution_plansList[ExecutionPlan]

Get the list of execution plans in the server. This list is obtained every time the property is accessed, so sequential accesses to this property in the same object might yield different results.

Returns: List[ExecutionPlan]: The list of execution plans in the server.

property
statusServerStatus

Get the status of the server. This status is obtained every time the property is accessed, so sequential accesses to this property in the same object might yield different results.

Returns: ServerStatus: The status of the server.

property
transactionsList[Transaction]

Get the list of transactions in the server. This list is obtained every time the property is accessed, so sequential accesses to this property in the same object might yield different results.

Returns: List[Transaction]: The list of transactions in the server.

property
usersList[User]

Get the list of users in the server. This list is obtained every time the property is accessed, so sequential accesses to this property in the same object might yield different results.

Returns: List[User]: The list of users in the server.

collection_create
def collection_create(
name: str,
description: str = None,
raise_for_status: bool = True,
) -> Collection

Create a collection in the server.

Parameters:

parameter
namestr

The name of the collection.

parameter
descriptionstr, optional

The description of the collection.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the collection could not be created.

collection_delete
def collection_delete(name: str, raise_for_status: bool = True)

Delete a collection in the server.

Parameters:

parameter
namestr

The name of the collection.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the collection could not be deleted.

collection_get
def collection_get(name: str) -> Collection

Get a collection in the server.

Parameters:

parameter
namestr

The name of the collection.

Returns:

Collection: The collection.

Raises:

APIServerError: If the collection could not be obtained.

collection_list_functions
def collection_list_functions(collection_name) -> List[Function]

List the functions in a collection.

Parameters:

parameter
collection_namestr

The name of the collection.

Returns:

List[Function]: The list of functions in the collection.

Raises:

APIServerError: If the functions could not be listed.

collection_update
def collection_update(
name: str,
new_name = None,
new_description: str = None,
raise_for_status: bool = True,
)

Update a collection in the server.

Parameters:

parameter
namestr

The name of the collection.

parameter
new_namestr, optional

The new name of the collection.

parameter
new_descriptionstr, optional

The new description of the collection.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the collection could not be updated.

dataversion_list
def dataversion_list(
collection_name: str,
function_name: str,
offset: int = None,
len: int = None,
) -> List[DataVersion]

List the data versions of a function in a collection.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
function_namestr

The name of the function.

parameter
offsetint, optional

The offset of the data versions to list.

parameter
lenint, optional

The number of data versions to list.

Returns:

List[DataVersion]: The list of data versions of the function.

Raises:

APIServerError: If the data versions could not be listed.

execution_plan_read
def execution_plan_read(execution_plan_id: str) -> str

Read the execution plan in the server.

Parameters:

parameter
execution_plan_idstr

The ID of the execution plan.

Returns:

str: The execution plan.

function_create
def function_create(
collection_name: str,
function_path: str,
description: str = None,
path_to_bundle: str = None,
requirements: str = None,
local_packages: List[str] | str | None = None,
function_name: str = None,
raise_for_status: bool = True,
) -> Function

Create a function in the server.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
function_pathstr

The path to the function. It should be in the form of /path/to/file.py::function_name.

parameter
descriptionstr, optional

The description of the function.

parameter
path_to_bundlestr, optional

The path that has to be bundled and sent to the server. If None, the folder containing the function will be bundled.

parameter
requirementsstr, optional

Path to a custom requirements.yaml file with the packages, python version and other information needed to create the Python environment for the function to run in the backend. If not provided, this information will be inferred from the current execution session.

parameter
local_packagesList[str] | str, optional

A list of paths to local Python packages that need to be included in the bundle. Each path must exist and be a valid Python package that can be installed by running pip install /path/to/package.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the function could not be created.

function_delete
def function_delete(collection_name, function_name, raise_for_status: bool = True)

Delete a function in the server.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
function_namestr

The name of the function.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the function could not be deleted.

function_get
def function_get(collection_name, function_name) -> Function

Get a function in the server.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
function_namestr

The name of the function.

Returns:

Function: The function.

Raises:

APIServerError: If the function could not be obtained.

function_list_history
def function_list_history(collection_name, function_name) -> List[Function]

List the version history of a function.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
function_namestr

The name of the function.

Returns:

List[Function]: The list of versions of the function.

Raises:

APIServerError: If the data could not be listed.

function_trigger
def function_trigger(
collection_name,
function_name,
execution_plan_name: str | None = None,
raise_for_status: bool = True,
) -> Response

Trigger a function in the server.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
function_namestr

The name of the function.

parameter
execution_plan_namestr, optional

The name of the execution plan.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Returns:

requests.Response: The response of the trigger request.

Raises:

APIServerError: If the function could not be triggered.

function_update
def function_update(
collection_name: str,
function_name: str,
function_path: str,
description: str,
directory_to_bundle: str = None,
requirements: str = None,
local_packages: List[str] | str | None = None,
new_function_name: str = None,
raise_for_status: bool = True,
) -> Function

Update a function in the server.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
function_namestr

The name of the function.

parameter
function_pathstr

The path to the function. It should be in the form of /path/to/file.py::function_name.

parameter
descriptionstr

The new description of the function.

parameter
directory_to_bundlestr, optional

The path that has to be bundled and sent to the server. If None, the folder containing the function will be bundled.

parameter
requirementsstr, optional

Path to a custom requirements.yaml file with the packages, python version and other information needed to create the Python environment for the function to run in the backend. If not provided, this information will be inferred from the current execution session.

parameter
local_packagesList[str] | str, optional

A list of paths to local Python packages that need to be included in the bundle. Each path must exist and be a valid Python package that can be installed by running pip install /path/to/package.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the function could not be updated.

table_download
def table_download(
collection_name: str,
table_name: str,
destination_file: str,
commit: str = None,
time: str = None,
version: str = None,
raise_for_status: bool = True,
)

Download a table for a given version as a parquet file. The version can be a fixed version or a relative one (HEAD, HEAD^, and HEAD~## syntax).

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
table_namestr

The name of the table.

parameter
destination_filestr

The path to the destination file.

parameter
commitstr, optional

The commit ID of the table to be downloaded.

parameter
timestr, optional

If provided, the table version that was published last before that time will be downloaded.

parameter
versionstr, optional

The version of the table to be downloaded. The version can be a fixed version or a relative one (HEAD, HEAD^, and HEAD~## syntax). Defaults to "HEAD".

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the schema could not be obtained.

table_get_schema
def table_get_schema(
collection_name: str,
table_name: str,
commit: str = None,
time: str = None,
version: str = None,
) -> dict

Get the schema of a table for a given version. The version can be a fixed version or a relative one (HEAD, HEAD^, and HEAD~## syntax).

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
table_namestr

The name of the table.

parameter
commitstr, optional

The commit ID of the table from which we will obtain the schema.

parameter
timestr, optional

If provided, the table version that was published last before that time will be the one queried for its schema.

parameter
versionstr, optional

The version of the table to be queried for its schema. The version can be a fixed version or a relative one (HEAD, HEAD^, and HEAD~## syntax). Defaults to "HEAD".

Returns:

dict: The schema of the table.

Raises:

APIServerError: If the schema could not be obtained.

table_list
def table_list(collection_name: str, offset: int = None, len: int = None) -> List[Table]

List the tables in a collection.

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
offsetint, optional

The offset of the list.

parameter
lenint, optional

The length of the list.

Returns:

List[Table]: The requested list of tables in the collection.

table_sample
def table_sample(
collection_name: str,
table_name: str,
commit: str = None,
time: str = None,
version: str = None,
offset: int = None,
len: int = None,
) -> DataFrame

Get a sample of a table for a given version as a parquet file. The version can be a fixed version or a relative one (HEAD, HEAD^, and HEAD~## syntax).

Parameters:

parameter
collection_namestr

The name of the collection.

parameter
table_namestr

The name of the table.

parameter
commitstr, optional

The commit ID of the table from which we will obtain the sample.

parameter
timestr, optional

If provided, the table version that was published last before that time will be the one queried for a sample.

parameter
versionstr, optional

The version of the table to be queried for a sample. The version can be a fixed version or a relative one (HEAD, HEAD^, and HEAD~## syntax). Defaults to "HEAD".

parameter
offsetint, optional

The offset of the sample.

parameter
lenint, optional

The length of the sample.

Raises:

APIServerError: If the schema could not be obtained.

transaction_cancel
def transaction_cancel(transaction_id: str) -> Response

Cancel an execution plan. This includes all functions that are part of the execution plan and all its dependants.

Parameters:

parameter
transaction_idstr

The ID of the execution plan to cancel.

Returns:

requests.Response: The response of the server to the request.

Raises:

APIServerError: If the execution_plan_id is not found in the system.

transaction_recover
def transaction_recover(transaction_id: str) -> Response

Recover an execution plan. This includes all functions that are part of the execution plan and all its dependants.

Parameters:

parameter
transaction_idstr

The ID of the execution plan to recover.

Returns:

requests.Response: The response of the server to the request.

Raises:

APIServerError: If the execution_plan_id is not found in the system.

user_create
def user_create(
name: str,
password: str,
full_name: str = None,
email: str = None,
enabled: bool = True,
raise_for_status: bool = True,
) -> User

Create a user in the server.

Parameters:

parameter
namestr

The name of the user.

parameter
passwordstr

The password of the user.

parameter
full_namestr, optional

The full name of the user.

parameter
emailstr, optional

The email of the user.

parameter
enabledbool, optional

Whether the user is enabled or not.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the user could not be created.

user_delete
def user_delete(name: str, raise_for_status: bool = True)

Delete a user in the server.

Parameters:

parameter
namestr

The name of the user.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the user could not be deleted.

user_get
def user_get(name: str) -> User

Get a user in the server.

Parameters:

parameter
namestr

The name of the user.

Returns:

User: The user.

Raises:

APIServerError: If the user could not be obtained.

user_update
def user_update(
name: str,
full_name: str = None,
email: str = None,
enabled: bool = None,
raise_for_status: bool = True,
)

Update a user in the server.

Parameters:

parameter
namestr

The name of the user.

parameter
full_namestr, optional

The full name of the user.

parameter
emailstr, optional

The email of the user.

parameter
enabledbool, optional

Whether the user is enabled or not.

parameter
raise_for_statusbool, optional

Whether to raise an exception if the request was not successful. Defaults to True.

Raises:

APIServerError: If the user could not be updated.

worker_list
def worker_list(
by_function_id: str = None,
by_transaction_id: str = None,
by_execution_plan_id: str = None,
by_data_version_id: str = None,
)

worker_log
def worker_log(worker_id: str) -> str

Get the logs of a worker in the server.

Parameters:

parameter
worker_idstr

The ID of the worker.

Returns:

str: The worker logs.


User

class User(
connection: APIServer,
name: str,
full_name: str = None,
email: str = None,
enabled: bool = None,
**kwargs,
)

This class represents a user in the TabsdataServer.

Parameters:

parameter
namestr

The name of the user.

parameter
full_namestr

The full name of the user.

parameter
emailstr

The email of the user.

parameter
enabledbool

Whether the user is enabled or not.

parameter
**kwargs

Additional keyword arguments.

Initialize the User object.

Parameters:

parameter
namestr

The name of the user.

parameter
full_namestr

The full name of the user.

parameter
emailstr

The email of the user.

parameter
enabledbool

Whether the user is enabled or not.

parameter
**kwargs

Additional keyword arguments.

property
emailstr

property
enabledbool

property
full_namestr

create
def create(password: str, raise_for_status = True) -> User

delete
def delete(raise_for_status: bool = True)

refresh
def refresh() -> User

update
def update(
full_name: str = None,
email: str = None,
enabled: bool = None,
raise_for_status: bool = True,
) -> User