Backend#
- class nominal.ibis.Backend(*args, **kwargs)#
Bases:
SQLBackend,NoUrlIbis backend executing queries against the Nominal SQL API.
- compiler = <nominal.ibis._backend.NominalCompiler object>#
- name = 'nominal'#
- supports_python_udfs = False#
- supports_temporary_tables = False#
- property version: str#
Return the version of the backend engine.
For database servers, return the server version.
For others such as SQLite and pandas return the version of the underlying library or application.
Returns#
- str
The backend version
- create_table(*args, **kwargs)#
Create a new table.
Parameters#
- name
Name of the new table.
- obj
An Ibis table expression or pandas table that will be used to extract the schema and the data of the new table. If not provided,
schemamust be given.- schema
The schema for the new table. Only one of
schemaorobjcan be provided.- database
Name of the database where the table will be created, if not the default.
- temp
Whether a table is temporary or not
- overwrite
Whether to clobber existing data
Returns#
- Table
The table that was created.
- Return type:
Table
- create_view(*args, **kwargs)#
Create a view from an Ibis expression.
Parameters#
- name
The name of the view to create.
- obj
The Ibis expression to create the view from.
- database
The database that the view should be created in.
- overwrite
If
True, replace an existing view with the same name.
Returns#
- ir.Table
A table expression representing the view.
- Return type:
Table
- disconnect()#
No-op: the gRPC channel belongs to the NominalClient.
- do_connect(client)#
Use an existing client and fetch the SQL catalog.
- Parameters:
client (NominalClient)
Authenticated Nominal client. Queries run in its default workspace, either the one pinned in the profile or the tenant default.
- drop_table(*args, **kwargs)#
Drop a table from the backend.
Parameters#
- name
The name of the table to drop
- database
The database that the table is located in.
- force
If
True, do not raise an error if the table does not exist.
- drop_view(*args, **kwargs)#
Drop a view from the backend.
Parameters#
- name
The name of the view to drop.
- database
The database that the view is located in.
- force
If
True, do not raise an error if the view does not exist.
- execute(expr, /, *, params=None, limit=None, **kwargs)#
Execute an Ibis expression and return a pandas
DataFrame,Series, or scalar.Parameters#
- expr
Ibis expression to execute.
- params
Mapping of scalar parameter expressions to value.
- limit
An integer to effect a specific row limit. A value of
Nonemeans no limit. The default is inibis/config.py.- kwargs
Keyword arguments
Returns#
- DataFrame | Series | scalar
The result of the expression execution.
- Return type:
- get_schema(table_name, *, catalog=None, database=None)#
- Return type:
Schema
- list_tables(*, like=None, database=None)#
Return the sorted names of the tables in the Nominal SQL catalog.
- raw_sql(query)#
- Return type:
Table
- to_pyarrow(expr, /, *, params=None, limit=None, **kwargs)#
Execute the expression and return its result as a PyArrow Table, ChunkedArray, or Scalar.
- Return type:
- to_pyarrow_batches(expr, /, *, params=None, limit=None, chunk_size=1_000_000, **kwargs)#
Execute the expression, streaming record batches without materializing the result.
Closing the reader releases the active query stream. Errors encountered while reading batches are reported as PyArrow exceptions.
- Return type:
RecordBatchReader