Connection
geneva.db.Connection
Bases: DBConnection
Geneva Connection.
effective_system_namespace
Effective namespace after backend-compatibility fallback.
system_table_connection
system_table_connection: Connection
Connection used to access system tables.
namespace_client
Returns namespace client if using namespace connection.
resolve_system_table_location
resolve_system_table_location(
namespace: list[str] | None = None,
) -> tuple[Connection, list[str]]
Resolve the target connection/namespace for system table operations.
migrate_legacy_system_table_if_needed
migrate_legacy_system_table_if_needed(
*,
table_name: str,
target_conn: Connection,
target_namespace: list[str] | None,
) -> None
Best-effort migration from legacy system-table locations.
Legacy locations:
- Local/object-store direct connections: Resolve and prepare the destination for a system-table operation. Open or create a Geneva internal table in its resolved location. List all available tables and views. Open a Lance Table. Parameters: Name of the table. Additional options for the storage backend.
Options already set on the connection will be inherited by the table,
but can be overridden here. See available options at
https://lancedb.github.io/lancedb/guides/storage/ Namespace path for the table (e.g., ["workspace"]) Create a Table in the lake Parameters: The name of the table User must provide at least one of Acceptable types are: The mode to use when creating the table.
Can be either "create" or "overwrite".
By default, if the table already exists, an exception is raised.
If you want to overwrite the table, use mode="overwrite". If a table by the same name already exists, then raise an exception
if exist_ok=False. If exist_ok=True, then open the existing table;
it will not add the provided data but will validate against any
schema that's specified. What to do if any of the vectors are not the same size or contain NaNs.
One of "error", "drop", "fill". Create a View from a Query. Parameters: Name of the view. SQL query to create the view. If True, the view is materialized. Create a materialized view Parameters: Name of the materialized view. Query to create the view. If True, the view is materialized, if false it is ready for refresh. Create a UDTF-backed materialized view. The view is created empty; call Parameters: Name for the new view table. Query defining the source data. The UDTF to execute on refresh. Create a scalar UDTF-backed materialized view (1:N row expansion). The view is created with placeholder rows (one per source row) that are
populated on Parameters: Name for the new view table. Query defining the source data. The scalar UDTF to execute on refresh. Define a persistent Geneva cluster. This will upsert the cluster definition by
name. The cluster can then be provisioned using Parameters: Name of the cluster. This will be used as the key when upserting and
provisioning the cluster. The cluster name must comply with RFC 12123. The cluster definition to store. List the cluster definitions. These can be defined using Returns: List of Geneva cluster definitions Delete a Geneva cluster definition. Parameters: Name of the cluster to delete. Define a persistent Geneva Manifest that represents the files and dependencies
used in the execution environment. This will upsert the manifest definition by
name and upload the required artifacts. The manifest can then be used with
Parameters: Name of the manifest. This will be used as the key when upserting and
loading the manifest. The manifest definition to use. An optional, custom Uploader to use. If not provided, the uploader will be
auto-detected based on the
environment configuration. List the manifest definitions. These can be defined using Returns: List of Geneva manifest definitions Delete a Geneva manifest definition. Parameters: Name of the manifest to delete. Context manager for a local Ray instance.
This will provision a local Ray instance and return a context manager.
This is useful for development or small jobs. Context manager for a Geneva Execution Environment.
This will provision a cluster based on the cluster
definition and the manifest provided.
By default, the context manager will delete the cluster on exit.
This can be configured with the on_exit parameter. Parameters: Name of the persisted cluster definition to use. Required.
This will raise an exception if the cluster definition was not
defined via Optional name of the persisted manifest to use. This will
raise an exception if the manifest definition was not
defined via Exit mode for the cluster. By default, the cluster waits for all
running jobs to complete before deleting.
To retain the cluster when any job fails or the context body
raises an exception, use Internal/experimental. Maximum seconds to wait for tracked jobs
during context exit. Only applies with DELETE or
RETAIN_ON_FAILURE. None means wait indefinitely. For
RETAIN_ON_FAILURE, a timeout is treated as a failure and the
cluster is retained. Whether to send Ray worker logs to the driver. Defaults to True for
better visibility in tests and debugging. The logging level for Ray workers. Use logging.DEBUG for detailed logs..lance (root)
- Remote connections: root namespace []
- Namespace connections: default namespace ["default"]
prepare_system_table_target
prepare_system_table_target(
table_name: str, namespace: list[str] | None = None
) -> tuple[Connection, list[str]]
alter_or_create_system_table
alter_or_create_system_table(
table_name: str,
model: Any,
namespace: list[str] | None = None,
) -> tuple[Connection, Table]
table_names
table_names(
page_token: str | None = None,
limit: int | None = None,
*args,
**kwargs,
) -> Iterable[str]
open_table
open_table(
name: str,
storage_options: dict[str, str] | None = None,
index_cache_size: int | None = None,
version: int | None = None,
namespace: list[str] | None = None,
*args,
**kwargs,
) -> Table
name
(str)
–
storage_options
(dict[str, str] | None, default:
None
)
–
namespace
(list[str] | None, default:
None
)
–
create_table
create_table(
name: str,
data: DATA | None = None,
schema: Schema | LanceModel | None = None,
mode: str = "create",
exist_ok: bool = False,
on_bad_vectors: str = "error",
fill_value: float = 0.0,
storage_options: dict[str, str] | None = None,
*args,
**kwargs,
) -> Table
name
(str)
–
data
(DATA | None, default:
None
)
–
data or schema.
Acceptable types are:
schema
(Schema | LanceModel | None, default:
None
)
–
mode
(str, default:
'create'
)
–
exist_ok
(bool, default:
False
)
–
on_bad_vectors
(str, default:
'error'
)
–
create_view
create_view(
name: str, query: str, materialized: bool = False
) -> Table
name
(str)
–
query
(str)
–
materialized
(bool, default:
False
)
–
create_materialized_view
create_materialized_view(
name: str,
query: GenevaQueryBuilder,
with_no_data: bool = True,
) -> Table
name
(str)
–
query
(GenevaQueryBuilder)
–
with_no_data
(bool, default:
True
)
–
create_udtf_view
create_udtf_view(
name: str, source: GenevaQueryBuilder, udtf: UDTF
) -> Table
view.refresh() to populate it.
name
(str)
–
source
(GenevaQueryBuilder)
–
udtf
(UDTF)
–
create_scalar_udtf_view
create_scalar_udtf_view(
name: str,
source: GenevaQueryBuilder,
scalar_udtf: ScalarUDTF,
) -> Table
view.refresh(). Each source row expands to zero or more
output rows via the scalar UDTF.
name
(str)
–
source
(GenevaQueryBuilder)
–
scalar_udtf
(ScalarUDTF)
–
define_cluster
define_cluster(name: str, cluster: GenevaCluster) -> None
context(cluster=name).
name
(str)
–
cluster
(GenevaCluster)
–
list_clusters
list_clusters() -> list[GenevaCluster]
define_cluster().
list[GenevaCluster]
–
delete_cluster
name
(str)
–
define_manifest
define_manifest(
name: str,
manifest: GenevaManifest,
uploader: Uploader | None = None,
) -> None
context(manifest=name).
name
(str)
–
manifest
(GenevaManifest)
–
uploader
(Uploader | None, default:
None
)
–
list_manifests
list_manifests() -> list[GenevaManifest]
define_manifest().
list[GenevaManifest]
–
delete_manifest
name
(str)
–
local_ray_context
context
context(
cluster: str,
manifest: str | None = None,
on_exit=None,
wait_timeout: float | None = None,
log_to_driver: bool = True,
logging_level=INFO,
) -> AbstractContextManager[None]
cluster
(str)
–
define_cluster().manifest
(str | None, default:
None
)
–
define_manifest(). If manifest is not provided,
the local environment will be uploaded.on_exit
–
ExitMode.RETAIN_ON_FAILURE.
To always retain the cluster, use ExitMode.RETAIN.wait_timeout
(float | None, default:
None
)
–
log_to_driver
(bool, default:
True
)
–
logging_level
–