
    ik                        U d Z ddlZddlZddlmZmZ ddlmZ ddlm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZkmlZlmmZmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZumvZv g dZw G d d	e      Zxd
ddZyeezezf   e{d<   i Z|eezezf   e{d<   dezdezddfdZ}dezdeezezf   dexfdZ~y)a.  Lance Namespace interface and plugin registry.

This module provides:
1. LanceNamespace ABC interface for namespace implementations
2. connect() factory function for creating namespace instances
3. register_namespace_impl() for external implementation registration
4. Re-exported model types from lance_namespace_urllib3_client
5. Error types for Lance Namespace operations

The actual implementations (DirectoryNamespace, RestNamespace) are provided
by the lance package. This package only provides the abstract interface
and plugin registration mechanism.
    N)ABCabstractmethod)Dict)	ErrorCodeLanceNamespaceErrorUnsupportedOperationErrorNamespaceNotFoundErrorNamespaceAlreadyExistsErrorNamespaceNotEmptyErrorTableNotFoundErrorTableAlreadyExistsErrorTableIndexNotFoundErrorTableIndexAlreadyExistsErrorTableTagNotFoundErrorTableTagAlreadyExistsErrorTransactionNotFoundErrorTableVersionNotFoundErrorTableColumnNotFoundErrorInvalidInputErrorConcurrentModificationErrorPermissionDeniedErrorUnauthenticatedErrorServiceUnavailableErrorInternalErrorInvalidTableStateErrorTableSchemaValidationErrorThrottlingErrorfrom_error_code)TAlterTableAddColumnsRequestAlterTableAddColumnsResponseAlterTableAlterColumnsRequestAlterTableAlterColumnsResponseAlterTableDropColumnsRequestAlterTableDropColumnsResponseAlterTransactionRequestAlterTransactionResponseAnalyzeTableQueryPlanRequestBatchDeleteTableVersionsRequest BatchDeleteTableVersionsResponseCountTableRowsRequestCreateEmptyTableRequestCreateEmptyTableResponseCreateNamespaceRequestCreateNamespaceResponseCreateTableIndexRequestCreateTableIndexResponseCreateTableScalarIndexResponseCreateTableRequestCreateTableResponseCreateTableTagRequestCreateTableTagResponseCreateTableVersionRequestCreateTableVersionResponseDeclareTableRequestDeclareTableResponseDeleteFromTableRequestDeleteFromTableResponseDeleteTableTagRequestDeleteTableTagResponseDeregisterTableRequestDeregisterTableResponseDescribeNamespaceRequestDescribeNamespaceResponseDescribeTableIndexStatsRequestDescribeTableIndexStatsResponseDescribeTableRequestDescribeTableResponseDescribeTableVersionRequestDescribeTableVersionResponseDescribeTransactionRequestDescribeTransactionResponseDropNamespaceRequestDropNamespaceResponseDropTableIndexRequestDropTableIndexResponseDropTableRequestDropTableResponseExplainTableQueryPlanRequestGetTableStatsRequestGetTableStatsResponseGetTableTagVersionRequestGetTableTagVersionResponseInsertIntoTableRequestInsertIntoTableResponseListNamespacesRequestListNamespacesResponseListTableIndicesRequestListTableIndicesResponseListTableTagsRequestListTableTagsResponseListTableVersionsRequestListTableVersionsResponseListTablesRequestListTablesResponseMergeInsertIntoTableRequestMergeInsertIntoTableResponseNamespaceExistsRequestQueryTableRequestRegisterTableRequestRegisterTableResponseRenameTableRequestRenameTableResponseRestoreTableRequestRestoreTableResponseTableExistsRequestTableVersionUpdateTableRequestUpdateTableResponse UpdateTableSchemaMetadataRequest!UpdateTableSchemaMetadataResponseUpdateTableTagRequestUpdateTableTagResponse)qLanceNamespaceconnectregister_namespace_implNATIVE_IMPLSr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   c                      e Zd ZdZedefd       ZdedefdZ	de
defdZdedefdZdedefdZdedd	fd
ZdedefdZdedefdZdedefdZdedd	fdZde de!fdZ"de#de$fdZ%de&de'fdZ(de)de*de+fdZ,de-de.fdZ/de0de1fdZ2de3de*de4fdZ5de6de*de7fdZ8de9de:fdZ;de<de=fdZ>de?de*fdZ@deAdeBfdZCdeAdeDfdZEdeFdeGfdZHdeIdeJfdZKdeLdeMfdZNdedefd ZOdePdeQfd!ZRdeSdeTfd"ZUdeVdeWfd#ZXdeYdeZfd$Z[de\de]fd%Z^de_de`fd&Zadebdecfd'Zddeedeffd(Zgdehdefd)Zidejdefd*Zkdeldemfd+Zndeodepfd,Zqderdesfd-Ztdeudevfd.Zwdexdeyfd/Zzde{de|fd0Z}de~defd1Zdedefd2Zdedefd3Zdedefd4Zy	)5rs   a  Base interface for Lance Namespace implementations.

    This abstract base class defines the contract for namespace implementations
    that manage Lance tables. Implementations can provide different storage backends
    (directory-based, REST API, cloud catalogs, etc.).

    To create a custom namespace implementation, subclass this ABC and implement
    at least the `namespace_id()` method. Other methods have default implementations
    that raise `UnsupportedOperationError`.

    Native implementations (DirectoryNamespace, RestNamespace) are provided by the
    lance package. External integrations (Glue, Hive, Unity) can be registered
    using `register_namespace_impl()`.

    All operations may raise the following common errors:

    - UnsupportedOperationError: The operation is not supported by this backend
    - InvalidInputError: The request contains invalid parameters
    - PermissionDeniedError: The user lacks permission for this operation
    - UnauthenticatedError: Authentication credentials are missing or invalid
    - ServiceUnavailableError: The service is temporarily unavailable
    - InternalError: An unexpected internal error occurred

    See the individual method docstrings for operation-specific errors.
    returnc                      y)a  Return a human-readable unique identifier for this namespace instance.

        This is used for equality comparison and hashing when the namespace is
        used as part of a storage options provider. Two namespace instances with
        the same ID are considered equal and will share cached resources.

        The ID should be human-readable for debugging and logging purposes.
        For example:
        - REST namespace: "RestNamespace { uri: 'https://api.example.com' }"
        - Directory namespace: "DirectoryNamespace { root: '/path/to/data' }"

        Returns
        -------
        str
            A human-readable unique identifier string
        N )selfs    T/mnt/e/genesis-system/.venv/lib/python3.12/site-packages/lance_namespace/__init__.pynamespace_idzLanceNamespace.namespace_id'  s    $ 	    requestc                     t        d      )zList namespaces.

        Raises
        ------
        NamespaceNotFoundError
            If the parent namespace does not exist.
        zNot supported: list_namespacesr   r{   r   s     r|   list_namespaceszLanceNamespace.list_namespaces;  s     ((HIIr~   c                     t        d      )zDescribe a namespace.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        z!Not supported: describe_namespacer   r   s     r|   describe_namespacez!LanceNamespace.describe_namespaceE  s     ((KLLr~   c                     t        d      )zCreate a new namespace.

        Raises
        ------
        NamespaceAlreadyExistsError
            If a namespace with the same name already exists.
        zNot supported: create_namespacer   r   s     r|   create_namespacezLanceNamespace.create_namespaceQ  s     ((IJJr~   c                     t        d      )zDrop a namespace.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        NamespaceNotEmptyError
            If the namespace contains tables or child namespaces.
        zNot supported: drop_namespacer   r   s     r|   drop_namespacezLanceNamespace.drop_namespace]  s     ((GHHr~   Nc                     t        d      )zCheck if a namespace exists.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        zNot supported: namespace_existsr   r   s     r|   namespace_existszLanceNamespace.namespace_existsi  s     ((IJJr~   c                     t        d      )zList tables in a namespace.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        zNot supported: list_tablesr   r   s     r|   list_tableszLanceNamespace.list_tabless  s     ((DEEr~   c                     t        d      )a   Describe a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableVersionNotFoundError
            If the specified version does not exist.
        zNot supported: describe_tabler   r   s     r|   describe_tablezLanceNamespace.describe_table}       ((GHHr~   c                     t        d      )a=  Register a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableAlreadyExistsError
            If a table with the same name already exists.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        zNot supported: register_tabler   r   s     r|   register_tablezLanceNamespace.register_table  r   r~   c                     t        d      )zCheck if a table exists.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        zNot supported: table_existsr   r   s     r|   table_existszLanceNamespace.table_exists  s     ((EFFr~   c                     t        d      )zDrop a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        zNot supported: drop_tabler   r   s     r|   
drop_tablezLanceNamespace.drop_table  s     ((CDDr~   c                     t        d      )zDeregister a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        zNot supported: deregister_tabler   r   s     r|   deregister_tablezLanceNamespace.deregister_table       ((IJJr~   c                     t        d      )a%  Count rows in a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableVersionNotFoundError
            If the specified version does not exist.
        zNot supported: count_table_rowsr   r   s     r|   count_table_rowszLanceNamespace.count_table_rows  r   r~   request_datac                     t        d      )a  Create a new table with data from Arrow IPC stream.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableAlreadyExistsError
            If a table with the same name already exists.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        TableSchemaValidationError
            If the schema validation fails.
        zNot supported: create_tabler   r{   r   r   s      r|   create_tablezLanceNamespace.create_table        ((EFFr~   c                     t        d      )aV  Declare a table (metadata only operation).

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableAlreadyExistsError
            If a table with the same name already exists.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        zNot supported: declare_tabler   r   s     r|   declare_tablezLanceNamespace.declare_table       ((FGGr~   c                 P    t        j                  dt        d       t        d      )a  Create an empty table (metadata only operation).

        .. deprecated::
            Use :meth:`declare_table` instead.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableAlreadyExistsError
            If a table with the same name already exists.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        z;create_empty_table is deprecated, use declare_table instead   )
stacklevelz!Not supported: create_empty_table)warningswarnDeprecationWarningr   r   s     r|   create_empty_tablez!LanceNamespace.create_empty_table  s'    " 	I	

 ((KLLr~   c                     t        d      )a  Insert data into a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        InvalidTableStateError
            If the table is in an invalid state for this operation.
        TableSchemaValidationError
            If the schema validation fails.
        z Not supported: insert_into_tabler   r   s      r|   insert_into_tablez LanceNamespace.insert_into_table  s    $ ((JKKr~   c                     t        d      )a  Merge insert data into a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableColumnNotFoundError
            If a referenced column does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        InvalidTableStateError
            If the table is in an invalid state for this operation.
        z&Not supported: merge_insert_into_tabler   r   s      r|   merge_insert_into_tablez&LanceNamespace.merge_insert_into_table  s    $ ((PQQr~   c                     t        d      )a  Update a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableColumnNotFoundError
            If a referenced column does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        InvalidTableStateError
            If the table is in an invalid state for this operation.
        zNot supported: update_tabler   r   s     r|   update_tablezLanceNamespace.update_table/  r   r~   c                     t        d      )a  Delete from a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        InvalidTableStateError
            If the table is in an invalid state for this operation.
        z Not supported: delete_from_tabler   r   s     r|   delete_from_tablez LanceNamespace.delete_from_tableA  s      ((JKKr~   c                     t        d      )aq  Query a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableVersionNotFoundError
            If the specified version does not exist.
        TableColumnNotFoundError
            If a referenced column does not exist.
        zNot supported: query_tabler   r   s     r|   query_tablezLanceNamespace.query_tableS  s     ((DEEr~   c                     t        d      )a  Create a table index.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableIndexAlreadyExistsError
            If an index with the same name already exists.
        TableColumnNotFoundError
            If a referenced column does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        z!Not supported: create_table_indexr   r   s     r|   create_table_indexz!LanceNamespace.create_table_indexc  s    $ ((KLLr~   c                     t        d      )a  Create a scalar index on a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableIndexAlreadyExistsError
            If an index with the same name already exists.
        TableColumnNotFoundError
            If a referenced column does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        z(Not supported: create_table_scalar_indexr   r   s     r|   create_table_scalar_indexz(LanceNamespace.create_table_scalar_indexw      $ ((RSSr~   c                     t        d      )zList table indices.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        z!Not supported: list_table_indicesr   r   s     r|   list_table_indicesz!LanceNamespace.list_table_indices  s     ((KLLr~   c                     t        d      )a!  Describe table index statistics.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableIndexNotFoundError
            If the index does not exist.
        z)Not supported: describe_table_index_statsr   r   s     r|   describe_table_index_statsz)LanceNamespace.describe_table_index_stats  s     ((STTr~   c                     t        d      )a  Drop a table index.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableIndexNotFoundError
            If the index does not exist.
        zNot supported: drop_table_indexr   r   s     r|   drop_table_indexzLanceNamespace.drop_table_index       ((IJJr~   c                     t        d      )z&List all tables across all namespaces.zNot supported: list_all_tablesr   r   s     r|   list_all_tableszLanceNamespace.list_all_tables  s    '(HIIr~   c                     t        d      )a  Restore a table to a specific version.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableVersionNotFoundError
            If the specified version does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        zNot supported: restore_tabler   r   s     r|   restore_tablezLanceNamespace.restore_table  r   r~   c                     t        d      )a~  Rename a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableAlreadyExistsError
            If a table with the new name already exists.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        zNot supported: rename_tabler   r   s     r|   rename_tablezLanceNamespace.rename_table  s     ((EFFr~   c                     t        d      )zList all versions of a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        z"Not supported: list_table_versionsr   r   s     r|   list_table_versionsz"LanceNamespace.list_table_versions  s     ((LMMr~   c                     t        d      )a  Create a new table version entry.

        This operation supports put_if_not_exists semantics,
        where the operation fails if the version already exists.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        ConcurrentModificationError
            If the version already exists.
        z#Not supported: create_table_versionr   r   s     r|   create_table_versionz#LanceNamespace.create_table_version  s    " ((MNNr~   c                     t        d      )a|  Describe a specific table version.

        Returns the manifest path and metadata for the specified version.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableVersionNotFoundError
            If the specified version does not exist.
        z%Not supported: describe_table_versionr   r   s     r|   describe_table_versionz%LanceNamespace.describe_table_version  s      ((OPPr~   c                     t        d      )a  Delete table version metadata records.

        This operation deletes version tracking records, NOT the actual table data.
        It supports deleting ranges of versions for efficient bulk cleanup.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        z*Not supported: batch_delete_table_versionsr   r   s     r|   batch_delete_table_versionsz*LanceNamespace.batch_delete_table_versions  s     ((TUUr~   c                     t        d      )a3  Update table schema metadata.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        z+Not supported: update_table_schema_metadatar   r   s     r|   update_table_schema_metadataz+LanceNamespace.update_table_schema_metadata!  s     ((UVVr~   c                     t        d      )zGet table statistics.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        zNot supported: get_table_statsr   r   s     r|   get_table_statszLanceNamespace.get_table_stats1       ((HIIr~   c                     t        d      )zExplain a table query plan.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        z'Not supported: explain_table_query_planr   r   s     r|   explain_table_query_planz'LanceNamespace.explain_table_query_plan=       ((QRRr~   c                     t        d      )zAnalyze a table query plan.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        z'Not supported: analyze_table_query_planr   r   s     r|   analyze_table_query_planz'LanceNamespace.analyze_table_query_planI  r   r~   c                     t        d      )a|  Add columns to a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        TableSchemaValidationError
            If the schema validation fails.
        z&Not supported: alter_table_add_columnsr   r   s     r|   alter_table_add_columnsz&LanceNamespace.alter_table_add_columnsU  s      ((PQQr~   c                     t        d      )a  Alter columns in a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableColumnNotFoundError
            If a referenced column does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        TableSchemaValidationError
            If the schema validation fails.
        z(Not supported: alter_table_alter_columnsr   r   s     r|   alter_table_alter_columnsz(LanceNamespace.alter_table_alter_columnsg  r   r~   c                     t        d      )a  Drop columns from a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableColumnNotFoundError
            If a referenced column does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        z'Not supported: alter_table_drop_columnsr   r   s     r|   alter_table_drop_columnsz'LanceNamespace.alter_table_drop_columns{  s      ((QRRr~   c                     t        d      )zList all tags for a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        zNot supported: list_table_tagsr   r   s     r|   list_table_tagszLanceNamespace.list_table_tags  r   r~   c                     t        d      )a   Get the version for a specific tag.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableTagNotFoundError
            If the tag does not exist.
        z$Not supported: get_table_tag_versionr   r   s     r|   get_table_tag_versionz$LanceNamespace.get_table_tag_version  s     ((NOOr~   c                     t        d      )a  Create a tag for a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableTagAlreadyExistsError
            If a tag with the same name already exists.
        TableVersionNotFoundError
            If the specified version does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        zNot supported: create_table_tagr   r   s     r|   create_table_tagzLanceNamespace.create_table_tag      $ ((IJJr~   c                     t        d      )a  Delete a tag from a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableTagNotFoundError
            If the tag does not exist.
        zNot supported: delete_table_tagr   r   s     r|   delete_table_tagzLanceNamespace.delete_table_tag  r   r~   c                     t        d      )a  Update a tag for a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableTagNotFoundError
            If the tag does not exist.
        TableVersionNotFoundError
            If the specified version does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        zNot supported: update_table_tagr   r   s     r|   update_table_tagzLanceNamespace.update_table_tag  r   r~   c                     t        d      )zDescribe a transaction.

        Raises
        ------
        TransactionNotFoundError
            If the transaction does not exist.
        z#Not supported: describe_transactionr   r   s     r|   describe_transactionz#LanceNamespace.describe_transaction  s     ((MNNr~   c                     t        d      )zAlter a transaction.

        Raises
        ------
        TransactionNotFoundError
            If the transaction does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        z Not supported: alter_transactionr   r   s     r|   alter_transactionz LanceNamespace.alter_transaction  s     ((JKKr~   )__name__
__module____qualname____doc__r   strr}   rW   rX   r   r@   rA   r   r-   r.   r   rJ   rK   r   rc   r   r_   r`   r   rD   rE   r   re   rf   r   rk   r   rN   rO   r   r>   r?   r   r*   intr   r2   bytesr3   r   r8   r9   r   r+   r,   r   rU   rV   r   ra   rb   r   rm   rn   r   r:   r;   r   rd   r   r/   r0   r   r1   r   rY   rZ   r   rB   rC   r   rL   rM   r   r   ri   rj   r   rg   rh   r   r]   r^   r   r6   r7   r   rF   rG   r   r(   r)   r   ro   rp   r   rQ   rR   r   rP   r   r'   r   r   r    r   r!   r"   r   r#   r$   r   r[   r\   r   rS   rT   r   r4   r5   r   r<   r=   r   rq   rr   r   rH   rI   r   r%   r&   r   rz   r~   r|   rs   rs     s   4 c  &J'< JAW J
M/
M	"
M
K-
K	 
K
I&: 
I?T 
IK(> K4 KF#4 F9K FI&: I?T II&: I?T I
G$6 
G4 
G
E"2 
E7H 
EK-K	 KK(= K# KG)G9>G	G$H*H	H M.M	!M0L-L=BL	 L(R2RBGR	%R(G$6 G;N G$L-L	 L$F#4 F F M.M	!M(T.T	'T(M.M	!MU5U	(U K,K	K J'8 J=O JH%8 H=Q H G$6 G;N G N/N	"NO0O	#O&Q2Q	%Q$V6V	)V"W7W	*W 
J'; 
J@U 
J
S0L 
SQT 
S
S0L 
SQT 
SR2R	%R$T4T	'T(S3S	&S$
J'; 
J@U 
JP0P	#P K,K	K(K,K	K K,K	K(
O1
O	$
OL.L	!Lr~   rs   zlance.namespace.RestNamespacez"lance.namespace.DirectoryNamespace)restdirrv   _REGISTERED_IMPLSname
class_pathrx   c                     |t         | <   y)am  Register a namespace implementation with a short name.

    External libraries can use this to register their implementations,
    allowing users to use short names like "glue" instead of full class paths.

    Parameters
    ----------
    name : str
        Short name for the implementation (e.g., "glue", "hive2", "unity")
    class_path : str
        Full class path (e.g., "lance_glue.GlueNamespace")

    Examples
    --------
    >>> # Register a custom implementation
    >>> register_namespace_impl("glue", "lance_glue.GlueNamespace")
    >>> # Now users can use: connect("glue", {"catalog": "my_catalog"})
    N)r   )r   r   s     r|   ru   ru     s    & )dr~   impl
propertiesc                 b   t         j                  |       xs t        j                  |       xs | }	 |j                  dd      \  }}t	        j
                  |      }t        ||      }t        |t              st        d| d       |di |S # t        $ r}t        d| d|       d}~ww xY w)	an  Connect to a Lance namespace implementation.

    This factory function creates namespace instances based on implementation
    aliases or full class paths. It provides a unified way to instantiate
    different namespace backends.

    Parameters
    ----------
    impl : str
        Implementation alias or full class path. Built-in aliases:
        - "rest": RestNamespace (REST API client, provided by lance)
        - "dir": DirectoryNamespace (local/cloud filesystem, provided by lance)
        You can also use full class paths like "my.custom.Namespace"
        External libraries can register additional aliases using
        `register_namespace_impl()`.
    properties : Dict[str, str]
        Configuration properties passed to the namespace constructor

    Returns
    -------
    LanceNamespace
        The connected namespace instance

    Raises
    ------
    ValueError
        If the implementation class cannot be loaded or does not
        implement LanceNamespace interface

    Examples
    --------
    >>> # Connect to a directory namespace (requires lance package)
    >>> ns = connect("dir", {"root": "/path/to/data"})
    >>>
    >>> # Connect to a REST namespace (requires lance package)
    >>> ns = connect("rest", {"uri": "http://localhost:4099"})
    >>>
    >>> # Use a full class path
    >>> ns = connect("my_package.MyNamespace", {"key": "value"})
    .   zClass z, does not implement LanceNamespace interfacez#Failed to construct namespace impl z: Nrz   )rv   getr   rsplit	importlibimport_modulegetattr
issubclassrs   
ValueError	Exception)r   r   
impl_classmodule_name
class_namemodulenamespace_classes           r|   rt   rt     s    T !!$'N+<+@+@+FN$JR","3"3C";Z((5!&*5/>:$PQ  ,,, R>zl"QCPQQRs   AB 	B.B))B.)r   r  r   abcr   r   typingr   lance_namespace.errorsr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   %lance_namespace_urllib3_client.modelsr   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   __all__rs   rv   r   __annotations__r   ru   rt   rz   r~   r|   <module>r     sM     #       8U U U U U U U U U U U U U U U U U U U U U UnvrmLS mLd ,/ d38n  %' 4S> &)# )3 )4 ),7R# 7R4S> 7Rn 7Rr~   