Ë
    dQêjõ¬  ã                   óð  — 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!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/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`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZkmlZlmmZmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{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� eEZ‘eFZ’g d¢Z“ G d„ d	e«      Z”d
ddœZ•ee–e–f   e—d<   i Z˜ee–e–f   e—d<   de–de–ddfd„Z™de–dee–e–f   de”f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ÚTableBranchNotFoundErrorÚTableBranchAlreadyExistsErrorÚfrom_error_code)lÚAlterTableAddColumnsRequestÚAlterTableAddColumnsResponseÚAlterTableAlterColumnsRequestÚAlterTableAlterColumnsResponseÚ AlterTableBackfillColumnsRequestÚ!AlterTableBackfillColumnsResponseÚAlterTableDropColumnsRequestÚAlterTableDropColumnsResponseÚAlterTransactionRequestÚAlterTransactionResponseÚAnalyzeTableQueryPlanRequestÚBatchCommitTablesRequestÚBatchCommitTablesResponseÚBatchCreateTableVersionsRequestÚ BatchCreateTableVersionsResponseÚBatchDeleteTableVersionsRequestÚ BatchDeleteTableVersionsResponseÚCommitTableOperationÚCommitTableResultÚCountTableRowsRequestÚCountTableRowsResponseÚCreateMaterializedViewRequestÚCreateMaterializedViewResponseÚMaterializedViewUdtfEntryÚCreateTableVersionEntryÚCreateNamespaceRequestÚCreateNamespaceResponseÚCreateTableBranchRequestÚCreateTableBranchResponseÚCreateTableIndexRequestÚCreateTableIndexResponseÚCreateTableScalarIndexResponseÚCreateTableRequestÚCreateTableResponseÚCreateTableTagRequestÚCreateTableTagResponseÚCreateTableVersionRequestÚCreateTableVersionResponseÚDeclareTableRequestÚDeclareTableResponseÚDeleteFromTableRequestÚDeleteFromTableResponseÚDeleteTableBranchRequestÚDeleteTableBranchResponseÚ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ÚListTableBranchesRequestÚListTableBranchesResponseÚListTableIndicesRequestÚListTableIndicesResponseÚListTableTagsRequestÚListTableTagsResponseÚListTableVersionsRequestÚListTableVersionsResponseÚListTablesRequestÚListTablesResponseÚMergeInsertIntoTableRequestÚMergeInsertIntoTableResponseÚNamespaceExistsRequestÚNamespaceExistsResponseÚQueryTableRequestÚQueryTableResponseÚRefreshMaterializedViewRequestÚRefreshMaterializedViewResponseÚRegisterTableRequestÚRegisterTableResponseÚRenameTableRequestÚRenameTableResponseÚRestoreTableRequestÚRestoreTableResponseÚTableExistsRequestÚTableExistsResponseÚTableVersionÚUpdateFieldMetadataRequestÚUpdateFieldMetadataResponseÚUpdateTableRequestÚUpdateTableResponseÚ UpdateTableSchemaMetadataRequestÚ!UpdateTableSchemaMetadataResponseÚUpdateTableTagRequestÚUpdateTableTagResponse)�Ú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   ÚCreateEmptyTableRequestÚCreateEmptyTableResponser:   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   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r€   r�   r‚   rƒ   r„   r…   r†   r‡   rˆ   r‰   rŠ   r‹   rŒ   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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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e0fd„Z1	 	 	 	 d>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„ZAdeBdeCfd„ZDdeBdeEfd„ZFdeGdeHfd„ZIdeJdeKfd„ZLdeMdeNfd„ZOdedefd„ZPdeQdeRfd „ZSdeTdeUfd!„ZVdeWdeXfd"„ZYdeZde[fd#„Z\de]de^fd$„Z_de`deafd%„Zbdecdedfd&„Zedefdegfd'„Zhdeidejfd(„Zkdeldemfd)„Zndeodepfd*„Zqderdefd+„Zsdetdefd,„Zudevdewfd-„Zxdeydezfd.„Z{de|de}fd/„Z~dede€fd0„Z�de‚deƒfd1„Z„de…de†fd2„Z‡deˆde‰fd3„ZŠde‹deŒfd4„Z�deŽde�fd5„Z�de‘de’fd6„Z“de”de•fd7„Z–de—de˜fd8„Z™dešde›fd9„Zœde�dežfd:„ZŸde de¡fd;„Z¢de£de¤fd<„Z¥y=)?r�   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    ú]/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/lance_namespace/__init__.pyÚnamespace_idzLanceNamespace.namespace_idf  s   € ð$ 	ó    Úrequestc                 ó   — t        d«      ‚)z‹List namespaces.

        Raises
        ------
        NamespaceNotFoundError
            If the parent namespace does not exist.
        zNot supported: list_namespaces©r   ©r—   r›   s     r˜   Úlist_namespaceszLanceNamespace.list_namespacesz  s   € ô (Ð(HÓIÐIrš   c                 ó   — t        d«      ‚)z‰Describe a namespace.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        z!Not supported: describe_namespacer�   rž   s     r˜   Údescribe_namespacez!LanceNamespace.describe_namespace„  s   € ô (Ð(KÓLÐLrš   c                 ó   — t        d«      ‚)z¡Create 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_namespace�  s   € ô (Ð(IÓJÐJrš   c                 ó   — t        d«      ‚)zæDrop 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š   c                 ó   — t        d«      ‚)a  Check if a namespace exists.

        Returns
        -------
        NamespaceExistsResponse
            The response returned when the namespace exists.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        zNot supported: namespace_existsr�   rž   s     r˜   Únamespace_existszLanceNamespace.namespace_exists¨  s   € ô (Ð(IÓJÐJrš   c                 ó   — t        d«      ‚)z�List tables in a namespace.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        zNot supported: list_tablesr�   rž   s     r˜   Úlist_tableszLanceNamespace.list_tables¹  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«      ‚)aF  Check if a table exists.

        Returns
        -------
        TableExistsResponse
            The response returned when the 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«      ‚)zÅDrop 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«      ‚)zËDeregister 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ü  s   € ô (Ð(IÓJÐJrš   c                 ó   — t        d«      ‚)a˜  Count rows in a table.

        Returns
        -------
        CountTableRowsResponse
            The response containing the row count.

        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
  s   € ô& (Ð(IÓJÐJrš   Ú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_table1  ó   € ô (Ð(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_tableA  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_tableY  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_tablem  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_table“  s   € ô  (Ð(JÓKÐKrš   c                 ó   — t        d«      ‚)aû  Query a table.

        Returns
        -------
        QueryTableResponse
            The response containing the query results as Arrow IPC file data.

        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_table¥  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_indexº  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_indexÎ  ó   € ô$ (Ð(RÓSÐSrš   c                 ó   — t        d«      ‚)zËList 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«      ‚)zÕList 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_versions4  ó   € ô (Ð(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_versionB  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_versionU  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_versionsg  s   € ô (Ð(TÓUÐUrš   c                 ó   — t        d«      ‚)a·  Atomically create new version entries for multiple tables.

        This operation is atomic: either all table versions are created successfully,
        or none are created. If any version creation fails (e.g., due to conflict),
        the entire batch operation fails.

        Each entry in the request specifies the table identifier and version details.
        This supports put_if_not_exists semantics for each version entry.

        Raises
        ------
        NamespaceNotFoundError
            If any namespace does not exist.
        TableNotFoundError
            If any table does not exist.
        ConcurrentModificationError
            If any version already exists.
        z*Not supported: batch_create_table_versionsr�   rž   s     r˜   Úbatch_create_table_versionsz*LanceNamespace.batch_create_table_versionsx  s   € ô* (Ð(TÓUÐUrš   c                 ó   — t        d«      ‚)a‘  Atomically commit a batch of mixed table operations.

        This is a generalized version of `batch_create_table_versions` that supports
        mixed operation types (DeclareTable, CreateTableVersion, DeleteTableVersions,
        DeregisterTable) within a single atomic transaction at the metadata layer.

        All operations are committed atomically: either all succeed or none are applied.

        Raises
        ------
        NamespaceNotFoundError
            If any namespace does not exist.
        TableNotFoundError
            If any table does not exist.
        ConcurrentModificationError
            If any operation conflicts.
        z"Not supported: batch_commit_tablesr�   rž   s     r˜   Úbatch_commit_tablesz"LanceNamespace.batch_commit_tables�  s   € ô( (Ð(LÓMÐMrš   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«      ‚)a0  Update per-field 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_field_metadatar�   rž   s     r˜   Úupdate_field_metadataz$LanceNamespace.update_field_metadataµ  ó   € ô (Ð(NÓOÐOrš   c                 ó   — t        d«      ‚)zÍGet 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_statsÅ  ó   € ô (Ð(HÓIÐIrš   c                 ó   — t        d«      ‚)zÓExplain 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«      ‚)zÓAnalyze 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_planÝ  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_columnsé  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_columnsû  rÔ   rš   c                 ó   — t        d«      ‚)z Trigger an async backfill job for a computed column.

        Raises
        ------
        TableNotFoundError
            If the table does not exist.
        z+Not supported: alter_table_backfill_columnsr�   rž   s     r˜   Úalter_table_backfill_columnsz+LanceNamespace.alter_table_backfill_columns  s   € ô (Ø9ó
ð 	
rš   c                 ó   — t        d«      ‚)z£Create a materialized view.

        Raises
        ------
        TableAlreadyExistsError
            If a table with the same identifier already exists.
        z'Not supported: create_materialized_viewr�   rž   s     r˜   Úcreate_materialized_viewz'LanceNamespace.create_materialized_view  s   € ô (Ø5ó
ð 	
rš   c                 ó   — t        d«      ‚)z—Trigger an async materialized view refresh.

        Raises
        ------
        TableNotFoundError
            If the table does not exist.
        z(Not supported: refresh_materialized_viewr�   rž   s     r˜   Úrefresh_materialized_viewz(LanceNamespace.refresh_materialized_view+  s   € ô (Ø6ó
ð 	
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_columns9  s   € ô  (Ð(QÓRÐRrš   c                 ó   — t        d«      ‚)zÒList 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_tagsK  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_versionW  ró   rš   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_tagg  ó   € ô$ (Ð(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«      ‚)a†  Create a branch for a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        TableVersionNotFoundError
            If the source version does not exist.
        ConcurrentModificationError
            If a concurrent modification conflict occurs.
        z"Not supported: create_table_branchr�   rž   s     r˜   Úcreate_table_branchz"LanceNamespace.create_table_branchŸ  s   € ô  (Ð(LÓMÐMrš   c                 ó   — t        d«      ‚)zÖList all branches for a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        z"Not supported: list_table_branchesr�   rž   s     r˜   Úlist_table_branchesz"LanceNamespace.list_table_branches±  rä   rš   c                 ó   — t        d«      ‚)zÕDelete a branch from a table.

        Raises
        ------
        NamespaceNotFoundError
            If the namespace does not exist.
        TableNotFoundError
            If the table does not exist.
        z"Not supported: delete_table_branchr�   rž   s     r˜   Údelete_table_branchz"LanceNamespace.delete_table_branch¿  rä   rš   c                 ó   — t        d«      ‚)z�Describe 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«      ‚)zêAlter 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š   N)r›   r‘   r”   r’   )¦Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ústrr™   rh   ri   rŸ   rQ   rR   r¡   r:   r;   r£   r[   r\   r¥   rv   rw   r§   rr   rs   r©   rU   rV   r«   r|   r}   r®   r‚   rƒ   r°   r_   r`   r²   rO   rP   r´   r4   r5   r¶   rA   ÚbytesrB   rº   rG   rH   r½   rÅ   rf   rg   rÇ   rt   ru   rÉ   r‡   rˆ   rË   rI   rJ   rÍ   rx   ry   rÏ   r>   r?   rÑ   r@   rÓ   rl   rm   rÖ   rS   rT   rØ   r]   r^   rÚ   rÝ   r€   r�   rß   r~   r   rá   rp   rq   rã   rE   rF   ræ   rW   rX   rè   r0   r1   rê   r.   r/   rì   r,   r-   rî   r‰   rŠ   rð   r…   r†   rò   rb   rc   rõ   ra   rø   r+   rû   r!   r"   rý   r#   r$   rÿ   r%   r&   r  r6   r7   r  rz   r{   r  r'   r(   r  rn   ro   r	  rd   re   r  rC   rD   r  rM   rN   r  r‹   rŒ   r  r<   r=   r  rj   rk   r  rK   rL   r  rY   rZ   r  r)   r*   r  r–   rš   r˜   r�   r�   K  s\  „ ñð4 ð˜cò ó ðð&JÐ'<ð JÐAWó Jð
MØ/ð
Mà	"ó
Mð
KØ-ð
Kà	 ó
Kð
IÐ&:ð 
IÐ?Tó 
IðKØ-ðKà	 óKð"FÐ#4ð FÐ9Kó FðIÐ&:ð IÐ?Tó IðIÐ&:ð IÐ?Tó IðGÐ$6ð GÐ;Nó Gð"
EÐ"2ð 
EÐ7Hó 
EðKØ-ðKà	 óKðKØ,ðKà	óKð*GØ)ðGØ9>ðGà	óGð$HØ*ðHà	óHð MØ0ð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Ð9Kó 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ð"VØ6ðVà	)óVð.NØ/ðNà	"óNð,WØ7ðWà	*óWð PØ1ðPà	$óPð 
JÐ';ð 
JÐ@Uó 
Jð
SÐ0Lð 
SÐQTó 
Sð
SÐ0Lð 
SÐQTó 
SðRØ2ðRà	%óRð$TØ4ðTà	'óTð(
Ø7ð
à	*ó
ð
Ø4ð
à	'ó
ð
Ø5ð
à	(ó
ðSØ3ðSà	&óSð$
JÐ';ð 
JÐ@Uó 
JðPØ0ðPà	#óPð KØ,ðKà	óKð(KØ,ðKà	óKð KØ,ðKà	óKð(NØ/ðNà	"óNð$NØ/ðNà	"óNðNØ/ðNà	"óNð
OØ1ð
Oà	$ó
OðLØ.ðLà	!ôLrš   r�   zlance.namespace.RestNamespacez"lance.namespace.DirectoryNamespace)ÚrestÚdirr�   Ú_REGISTERED_IMPLSÚnameÚ
class_pathr”   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˜   r�   r�   ò  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: Nr–   )r�   Úgetr%  ÚrsplitÚ	importlibÚimport_moduleÚgetattrÚ
issubclassr�   Ú
ValueErrorÚ	Exception)r)  r*  Ú
impl_classÚmodule_nameÚ
class_nameÚmoduleÚnamespace_classÚes           r˜   rŽ   rŽ     sÃ   € ôT ×!Ñ! $Ó'ÒNÔ+<×+@Ñ+@ÀÓ+FÒNÈ$€JðRØ",×"3Ñ"3°C¸Ó";Ñˆ�ZÜ×(Ñ(¨Ó5ˆÜ! &¨*Ó5ˆä˜/¬>Ô:ÜØ˜˜Ð$PÐQóð ñ Ñ, Ñ,Ð,øÜò RÜÐ>¸z¸lÈ"ÈQÈCÐPÓQÐQûðRús   ²AB Â	B.ÂB)Â)B.)›r   r0  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   r   r    Ú%lance_namespace_urllib3_client.modelsr!   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   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r€   r�   r‚   rƒ   r„   r…   r†   r‡   rˆ   r‰   rŠ   r‹   rŒ   r‘   r’   Ú__all__r�   r�   r!  Ú__annotations__r%  r�   rŽ   r–   rš   r˜   ú<module>rB     s„  ðòó Û ß #Ý ÷÷ ÷ ÷ ÷ ÷ ÷ ñ ÷<m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ m÷ mó mðh -Ð Ø.Ð òS€ôlZL�Sô ZLð~ ,Ø/ñ €ˆd�3˜�8‰nó ð %'Ð �4˜˜S˜‘>Ó &ð) #ð )°3ð )¸4ó )ð,7R�#ð 7R 4¨¨S¨¡>ð 7R°nô 7Rrš   