Ë
    kQêjÒ¾ ã                  óæ  — d dl mZ d dlZd dlZd dl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 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 d dl m!Z! d d	l"m#Z#m$Z$m%Z% d
dl&m'Z' d
dl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z. d
dl/m0Z0 d dl1m2Z2 d dl3m4Z4m5Z5 d dl6m7Z7m8Z8m9Z9 d
dl:m;Z;m<Z<m=Z=m>Z>m?Z@mAZB d dlCZDd dlEZCd dlFmGZH d dlImJZK d dlLZMd
dlNmOZOmPZPmQZQ d
dlRmSZSmTZT d
dlUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZa d
dlbmcZc d
dldmeZemfZg d
dlhmiZi d
dljmkZkmlZl d
dlmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{Z{m|Z| d
dl}m~Z~mZm€Z€m�Z�m‚Z‚mƒZƒ d
dlUm„Z„ d
dl…m†Z†m‡Z‡mˆZˆm‰Z‰ 	 	 	 	 	 	 d~d„ZŠdZ‹dd„ZŒd€d „Z�d!ZŽd"Z�	 	 	 	 	 	 d�d#„Z�d‚d$„Z‘dƒd%„Z’dd&œ	 	 	 	 	 	 	 d„d'„Z“erJd
d(l”m•Z• d
d)l–m—Z˜m™Z™mšZšm›Z›mœZœm�Z�mžZžmfZfmŸZŸm Z m¡Z¡m¢Z¢m£Z£m¤Z¤m¥Z¥m¦Z¦m§Z§ d
d*lUm¨Z¨ d dl?Z?d dl©Z©d
d+l/mªZªm«Z«m¬Z¬m­Z­m®Z®m¯Z¯ eeWeXeYe[e`e^e_eVeZe\e]eaf   Z° G d,„ d-ed.¬/«      Z±h d0£Z²d…d1„Z³d†d2„Z´	 d‡	 	 	 dˆd3„Zµ	 d‡	 	 	 	 	 d‰d4„Z¶	 	 	 	 dŠd.d5œ	 	 	 	 	 	 	 	 	 	 	 	 	 d‹d6„Z·	 dŒ	 	 	 	 	 	 	 d�d7„Z¸	 	 	 	 	 	 dŽd8„Z¹d�d9„Zº	 	 	 	 	 	 d�d:„Z»d‘d;„Z¼	 	 	 	 	 	 d’d<„Z½d“d=„Z¾d”d>„Z¿d•d?„ZÀd•d@„ZÁd•dA„ZÂd–dB„ZÃd—dC„ZÄ edD¬E«       G dF„ dG«      «       ZÅd˜dH„ZÆ	 	 	 	 d™dI„ZÇdšdJ„ZÈd›dK„ZÉ	 	 	 	 	 	 dœdL„ZÊd�dM„ZËdždN„ZÌdŸdO„ZÍ	 	 	 	 	 	 d dP„ZÎ	 	 	 d¡	 	 	 	 	 d¢dQ„ZÏd£dR„ZÐdS„ ZÑ	 d‡ddTœ	 	 	 	 	 	 	 d¤dU„ZÒd¥dV„ZÓd¥dW„ZÔdX„ ZÕ G dY„ dZe«      Z— G d[„ d\e—«      ZÖ	 	 	 	 d¦	 	 	 	 	 	 	 	 	 	 	 d§d]„Z×	 	 	 	 	 	 	 	 d¨d^„ZØ	 	 	 	 	 	 d©d_„ZÙdªd`„ZÚ	 	 	 	 d¦	 	 	 	 	 	 	 	 	 	 	 	 	 d«da„ZÛ	 	 	 	 	 	 	 	 d¬db„ZÜd­dc„ZÝd•dd„ZÞd®de„Zßd¯df„Zà	 	 	 	 d°dg„Zád±dh„Zâd²di„Zãd³dj„Zäd´dk„Zå G dl„ dm«      Zæe G dn„ do«      «       Zçe G dp„ dq«      «       Zèe G dr„ ds«      «       Zée G dt„ du«      «       Zê G dv„ dw«      Zë G dx„ dy«      Zì G dz„ d{«      Zí G d|„ d}«      Zîy)µé    )ÚannotationsN)ÚABCÚabstractmethod)Ú	dataclass)ÚdatetimeÚ	timedelta)Úcached_property)ÚTYPE_CHECKINGÚAnyÚAsyncIteratorÚCallableÚDictÚIterableÚIteratorÚListÚLiteralÚOptionalÚSequenceÚTupleÚ	TypedDictÚUnionÚoverload)Úurlparse)Ú_hf_batchesÚ_register_optional_convertersÚto_scannableé   )Ú__version__)ÚBlobFileÚ_normalize_blob_descriptorÚ_normalize_blob_row_idsÚ_wrap_blob_filesÚstrip_auto_row_idsÚvalidate_blob_mode)ÚBlobMode)Úpeek_reader)ÚLOOPÚembedding_executor)ÚAsyncJobÚJobÚ
_typed_job)Ú_check_for_hugging_faceÚ_check_for_lanceÚ_check_for_pandasÚlanceÚpandasÚpolars)ÚDATAÚVECÚVECTOR_COLUMN_NAME)ÚEmbeddingFunctionConfigÚEmbeddingFunctionRegistry)ÚBTreeÚIvfFlatÚIvfPqÚIvfSqÚBitmapÚIvfRqÚ	LabelListÚFmÚHnswPqÚHnswSqÚHnswFlatÚFTS)ÚExpr)ÚFunctionApplicationÚRefreshColumnResult)ÚLanceMergeInsertBuilder)Ú
LanceModelÚmodel_to_dict)ÚAnalyzePlanDistributedMetricsÚAsyncFTSQueryÚAsyncHybridQueryÚ
AsyncQueryÚAsyncTakeQueryÚAsyncVectorQueryÚDocumentGranularityÚFullTextQueryÚLanceEmptyQueryBuilderÚLanceFtsQueryBuilderÚLanceHybridQueryBuilderÚLanceQueryBuilderÚLanceVectorQueryBuilderÚLanceTakeQueryBuilderÚQuery)Úadd_noteÚfs_from_uriÚget_uri_schemeÚinfer_vector_column_nameÚjoin_uriÚvalue_to_sql)Úlang_mapping)Úblob_v2_column_pathsÚis_blob_v2_fieldÚrow_addressable_blob_v2_pathsÚschema_has_blob_fieldc                ó   — | d uxr d|v S )NÚ
QueryTable© )Únamespace_clientÚpushdown_operationss     úR/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/lancedb/table.pyÚ_should_push_down_query_tableri   x   s   € ð  4Ð'ÒO¨LÐ<OÐ,OÐOó    zÞCUDA acceleration is unavailable in this Python environment. Install a CUDA-enabled PyTorch build and verify that the CUDA device is accessible, or omit `accelerator` (or set `accelerator=None`) to create the index on CPU.c                ó’  — t        | t        «      r| j                  dd«      d   dk7  ry 	 dd l}|j                  j                  «       }|st        t        «      ‚	 |j                  j                  «        y # t        t        t        f$ r}t        t        «      |‚d }~ww xY w# t        t        f$ r}t        t        «      |‚d }~ww xY w)Nú:r   r   Úcuda)Ú
isinstanceÚstrÚsplitÚtorchrm   Úis_availableÚImportErrorÚRuntimeErrorÚAssertionErrorÚ_CUDA_UNAVAILABLE_MESSAGEÚinit)Úacceleratorrq   Úcuda_availableÚerrs       rh   Ú_validate_index_acceleratorr{   …   s±   € Ü�k¤3Ô'¨;×+<Ñ+<¸SÀ!Ó+DÀQÑ+GÈ6Ò+QØð?ÛàŸ™×0Ñ0Ó2ˆñ ÜÔ4Ó5Ð5ð?Ø�
‰
�‰Õøô œ¤~Ð6ò ?ÜÔ4Ó5¸3Ð>ûð?ûô œ.Ð)ò ?ÜÔ4Ó5¸3Ð>ûð?ús/   «A6 ÁB" Á6BÂ
BÂBÂ"CÂ1CÃCc                ó   — | S )zBReturn a Polars frame unchanged while blocking predicate pushdown.re   )Úframes    rh   Ú"_polars_predicate_pushdown_barrierr~   ™   s   € à€Lrj   )ÚjiebaÚlindera)zunknown base tokenizerzInvalid directory path:zFailed to load JiebazFailed to load tokenizer configz&Failed to initialize default tokenizerc                óÄ   — d }| �=t        | j                  «       dz  «      }|dk  rt        j                  dt        d¬«       |rt        j                  dt
        d¬«       |S )Néè  r   záoptimize(cleanup_older_than=0) removes every version except the latest. Any concurrent reader or writer still using an older version will fail. Use a longer cleanup_older_than unless no other process is working on this table.é   ©Ú
stacklevelzNThe 'retrain' parameter is deprecated and will be removed in a future version.)ÚroundÚtotal_secondsÚwarningsÚwarnÚUserWarningÚDeprecationWarning)Úcleanup_older_thanÚretrainÚcleanup_since_mss      rh   Ú_optimize_cleanup_since_msr�   ¨   sp   € ð
 '+ÐØÐ%Ü Ð!3×!AÑ!AÓ!CÀdÑ!JÓKÐØ˜qÒ Ü�M‰MðDô Øõñ Ü�‰ðäØõ		
ð Ðrj   c                óÆ   — t        | dd«      xs d}| j                  r,t        | j                  d   t        «      r| j                  d   nd}||vr||vrt	        | |«       y y y )NÚ	__notes__re   r   Ú )ÚgetattrÚargsrn   ro   rX   )Ú	exceptionÚnoteÚexisting_notesÚmessages       rh   Ú_add_unique_noter™   Ä   si   € Ü˜Y¨°RÓ8Ò>¸B€Nð �>Š>œj¨¯©¸Ñ):¼CÔ@ð 	�‰�qÒàð ð
 �>Ñ! d°'Ñ&9Ü�˜DÕ!ð ':Ð!rj   c                ó4   ‡ — t        ˆ fd„t        D «       «      S )Nc              3  óT   •K  — | ]  }‰|k(  xs ‰j                  |› d �«      –— Œ! y­w)ú/N)Ú
startswith)Ú.0ÚprefixÚbase_tokenizers     €rh   ú	<genexpr>z-_is_model_backed_tokenizer.<locals>.<genexpr>Ð   s7   øè ø€ ò àð 	˜&Ñ ÒK N×$=Ñ$=ÀÀÈ¸lÓ$KÓKñùs   ƒ%()ÚanyÚ _MODEL_BACKED_TOKENIZER_PREFIXES)r    s   `rh   Ú_is_model_backed_tokenizerr¤   Ï   s   ø€ Üó ä6ôó ð rj   )Úlanguagec               óð   ‡— t        | «      Š|�7d‰v r3dj                  t        j                  «       «      }t	        | d|› �«       y t        |«      sy t        ˆfd„t        D «       «      sy t	        | d«       y )Nz"not support the requested languagez, zSupported languages: c              3  ó&   •K  — | ]  }|‰v –— Œ
 y ­w©Nre   )rž   Úmarkerr˜   s     €rh   r¡   z,_maybe_add_fts_error_note.<locals>.<genexpr>â   s   øè ø€ ÒN Vˆv˜Ô ÑNùs   ƒaK  Model-backed tokenizers such as 'jieba/default' and 'lindera/ipadic' require tokenizer models in Lance's language model home. Set LANCE_LANGUAGE_MODEL_HOME to override the default platform data directory under 'lance/language_models'. Expected layouts include '<model-home>/jieba/default/...' and '<model-home>/lindera/ipadic/...'.)ro   Újoinr^   Úvaluesr™   r¤   r¢   Ú_MODEL_BACKED_TOKENIZER_ERRORS)r•   r    r¥   Úsupported_langsr˜   s       @rh   Ú_maybe_add_fts_error_noter®   Ö   sv   ø€ ô �)‹n€GØÐÐ DÈÑ OØŸ)™)¤L×$7Ñ$7Ó$9Ó:ˆÜ˜Ð&;¸OÐ;LÐ$MÔNØä% nÔ5ØäÓNÔ/MÔNÔNØäØð	-õrj   )ÚLanceDBConnection)ÚTableÚOptimizeStatsÚCleanupStatsÚCompactionStatsÚTagÚAddColumnsResultÚFunctionErrorsrE   Ú	AddResultÚAlterColumnsResultÚUpdateFieldMetadataResultÚDeleteResultÚDropColumnsResultÚFtsTokenÚRTEWriteSpecÚMergeResultÚUpdateResult)ÚIndexConfig)Ú	QueryTypeÚOnBadVectorsTypeÚAddModeÚ
CreateModeÚScalarIndexTypeÚBaseTokenizerTypec                  óè   — e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 d	ed
<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   y)ÚCompactionOptionsa!  Options that control file compaction during table optimization.

    Unspecified options use Lance's defaults.

    Compaction planning is row based. Lowering ``target_rows_per_fragment``
    based on the expected row size can bound later compaction passes once
    oversized fragments have been rewritten. It does not split an existing
    fragment, so the first pass over an oversized fragment is not subject to
    that bound. ``max_bytes_per_file`` limits output file size, not compaction
    memory. Source budgets keep whole planned tasks; if the first task exceeds
    a budget, that run performs no compaction work.

    Examples
    --------
    Derive a steady-state row target from the expected row size:

    >>> desired_fragment_bytes = 750 * 1024 * 1024
    >>> average_row_bytes = 1_500_000
    >>> options: CompactionOptions = {
    ...     "target_rows_per_fragment": max(
    ...         1, desired_fragment_bytes // average_row_bytes
    ...     ),
    ... }
    >>> await table.optimize(compaction_options=options)  # doctest: +SKIP
    ÚintÚtarget_rows_per_fragmentÚmax_rows_per_groupúOptional[int]Úmax_bytes_per_fileÚboolÚmaterialize_deletionsÚfloatÚmaterialize_deletions_thresholdÚnum_threadsÚ
batch_sizeÚio_buffer_sizeÚdefer_index_remapzLiteral['direct', 'compact']Úindex_remap_modezEOptional[Literal['reencode', 'try_binary_copy', 'force_binary_copy']]Úcompaction_modeÚbinary_copy_read_batch_bytesÚmax_source_fragmentsÚmax_source_rowsÚmax_source_bytesz	List[int]Úexcluded_fragment_idsÚmax_overlays_per_fragmentro   Údata_storage_versionN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__re   rj   rh   rÈ   rÈ   "  s²   … ñð4 "Ó!ØOàÓØ@à%Ó%ØOàÓØOà%*Ó*ØUàÓØ8àÓØ.à!Ó!ØFàÓØNà2Ó2Ø>ðó ð Eà"/Ó/ØGà'Ó'ØBà"Ó"ØKà#Ó#ØGà$Ó$ØIà,Ó,Ø@àÓØErj   rÈ   F)Útotal>   Úl2ÚdotÚcosineÚhammingc                ó*  — | €yt        | t        t        t        f«      rdt        | «      iS t        | t        «      r| st        d«      ‚d| iS t        | t        «      r0| j                  «       h d£z
  }|rt        dt        |«      › �«      ‚| S 	 ddl	m
} t        | |«      r/| j                  | j                  | j                  | j                  d	œS t#        dt%        | «      j&                  › �«      ‚# t        $ r}|j                   d
vr‚ Y d}~Œ>d}~ww xY w)zHKeep a Python blob's inline data or external URI before Arrow infers it.NÚdatazBlob uri cannot be emptyÚuri>   rì   rë   ÚsizeÚpositionzUnknown blob fields: r   )ÚBlob)rë   rì   rî   rí   )r/   z
lance.blobzUnsupported blob value: )rn   ÚbytesÚ	bytearrayÚ
memoryviewro   Ú
ValueErrorÚdictÚkeysÚsortedÚ
lance.blobrï   rë   rì   rî   rí   ÚModuleNotFoundErrorÚnameÚ	TypeErrorÚtyperà   )ÚvalueÚunknownrï   rz   s       rh   Ú_blob_value_to_storagerþ   z  s	  € à€}ØÜ�%œ%¤¬JÐ7Ô8Øœ˜e›Ð%Ð%Ü�%œÔÙÜÐ7Ó8Ð8Ø�uˆ~ÐÜ�%œÔØ—*‘*“,Ò!DÑDˆÙÜÐ4´V¸G³_Ð4EÐFÓGÐGØˆðÝ#ô
 �e˜TÔ"àŸ
™
Ø—y‘yØ!ŸN™NØŸ
™
ñ	ð ô Ð.¬t°E«{×/CÑ/CÐ.DÐEÓ
FÐFøô ò Ø�8‰8Ð2Ñ2Øô 3ûðús   ÂC0 Ã0	DÃ9DÄDc                ó  ‡‡— |€yt        | t        «      rÅ| rÃt        | d   t        «      r°|D �‡ch c]-  Št        ‰«      r t	        ˆfd„| D «       «      r‰j
                  ’Œ/ }}|sy|D ��ci c]"  }|| D �cg c]  }|j                  |«      ‘Œ c}“Œ$ }}}| D ��cg c]  }i |¥|D �ci c]  }|d“Œ c}¥‘Œ }}}t        j                  j                  |«      }�nt        | «      �rt        | t        j                  «      rë|D �ch c]1  }t        |«      r$|j
                  | j                  v r|j
                  ’Œ3 }}|sy|D ��	ci c]O  }|| |   D �	cg c]=  }	|	t        j                  u s%t        |	t        «      rt!        j"                  |	«      rdn|	‘Œ? c}	“ŒQ }}}	t        j                  j%                   | j&                  di |D �ci c]  }|d“Œ c}¤Žd¬«      j)                  d«      }ny|D �]c  Š‰j
                  |vrŒt        ‰j*                  t        j,                  «      r‰j*                  j.                  n‰j*                  }
|‰j
                     D �	cg c]  }	t1        |	«      ‘Œ }}	ddht3        |
j4                  «      z
  Š‰r-t	        ˆfd„|D «       «      rt7        d	‰j
                  › d
�«      ‚t        j8                  ||
¬«      }t        ‰j*                  t        j,                  «      r*t        j:                  j=                  ‰j*                  |«      n|}|j?                  |j@                  jC                  ‰j
                  «      ‰|«      }�Œf |S c c}w c c}w c c}}w c c}w c c}}w c c}w c c}	w c c}	}w c c}w c c}	w )zJConvert Python rows with blob fields before Arrow loses their value types.Nr   c              3  ó^   •K  — | ]$  }t        |t        «      xr ‰j                  |v –— Œ& y ­wr¨   )rn   rô   rù   )rž   ÚrowÚfields     €rh   r¡   z'_blob_input_to_arrow.<locals>.<genexpr>¤  s)   øè ø€ ÒPÀC”J˜s¤DÓ)Ò?¨e¯j©j¸CÐ.?Ó?ÑPùs   ƒ*-F©Úpreserve_indexrî   rí   c              3  óT   •‡K  — | ]  Š‰d uxr t        ˆfd„‰D «       «      –— Œ  y ­w)Nc              3  óD   •K  — | ]  }‰j                  |«      d u–— Œ y ­wr¨   )Úget)rž   rù   rü   s     €rh   r¡   z1_blob_input_to_arrow.<locals>.<genexpr>.<genexpr>Ï  s   øè ø€ ÒQ°D�E—I‘I˜d“O¨4Ô/ÑQùs   ƒ )r¢   )rž   rü   Úmissing_range_fieldss    @€rh   r¡   z'_blob_input_to_arrow.<locals>.<genexpr>Í  s;   ùè ø€ ò (
ð ð ˜Ðò RÜÓQÐ<PÔQÓQóRñ(
ùs   „$(zBlob column 'zj' storage schema cannot store byte ranges. Create the column with lancedb.blob() to use position and size.©rû   re   )"rn   Úlistrô   r`   r¢   rù   r  Úpar°   Úfrom_pylistr.   ÚpdÚ	DataFrameÚcolumnsÚNArÐ   ÚnpÚisnanÚfrom_pandasÚassignÚreplace_schema_metadatarû   ÚExtensionTypeÚstorage_typerþ   ÚsetÚnamesró   ÚarrayÚExtensionArrayÚfrom_storageÚ
set_columnÚschemaÚget_field_index)rë   r  r  r  rù   r  r«   ÚrowsÚtablerü   r  Ústorage_valuesÚstorageÚcolumnr  s     `           @rh   Ú_blob_input_to_arrowr%  š  s`  ù€ à€~Øä�$œÔ¡$¬:°d¸1±g¼tÔ+Dð  ÷
àÜ Ô&ÜÓPÈ4ÔPÔPð �J‹Jð
ˆð 
ñ ØØDI×J¸D�$°$Ö7¨3˜Ÿ™ �Ò7Ñ7ÐJˆÑJØEI×J¸cÐ9�3Ð9°%Ö8¨$˜4 ™:Ò8Ò9ÐJˆÑJÜ—‘×$Ñ$ TÓ*ŠÜ	˜4Õ	 ¤Z°´b·l±lÔ%Cð  ö
àÜ Ô&¨5¯:©:¸¿¹Ñ+Eð �J‹Jð
ˆð 
ñ
 Øð ÷
ð ð ð " $™Zö	ð ð œBŸE™E‘>¤Z°´uÔ%=Ä"Ç(Á(È5Ä/ñ àñòñ ð
ˆñ 
ô —‘×$Ñ$ØˆD�K‰KÑ9°%Ö8¨$˜4 ™:Ò8Ñ9È%ð %ó 
ç
!Ñ
! $Ó
'ñ 	ð àó 
ˆØ�:‰:˜UÑ"Øô ˜%Ÿ*™*¤b×&6Ñ&6Ô7ð �J‰J×#Ò#à—‘ð 	ð
 FLÈEÏJÉJÑEWÖX¸EÔ0°Õ7ÐXˆÐXØ *¨FÐ3´c¸,×:LÑ:LÓ6MÑMÐá¤Có (
ð (ô(
ô %
ô
 Ø §
¡
˜|ð ,Rð Róð ô —(‘(˜>°Ô=ˆô ˜%Ÿ*™*¤b×&6Ñ&6Ô7ô ×Ñ×*Ñ*¨5¯:©:°wÔ?àð 	ð
 × Ñ Ø�L‰L×(Ñ(¨¯©Ó4°e¸Vó
Šð5
ð: €Lùò
ùò 8ùÓJùÚ8ùÓJùò
ùòùó
ùò 9ùò Ys`   °2MÁ,
M"Á6MÂM"ÂM-Â'
M(Â1M-Ä6M3ÅM=ÅAM8ÆM=Ç
NÉNÍM"Í(M-Í8M=c                ó~  — ddl m} t        | «      rït        | |j                  «      r?| j
                  j                  }t        j                  j                  |t        | «      «      S t        | |j                  j                  «      rzt        | d «      }d|j                  vr7|j                  t        j                   dt        j"                  «       «      «      }t        j                  j                  |t%        | «      «      S t        | t&        «      rt)        d«      ‚t        | t*        «      rt)        d«      ‚t        | t,        «      �rf| s<|€t)        d«      ‚t        j.                  j1                  | |¬«      j3                  «       S t        | d   t&        «      rt| d   j4                  j7                  «       }| D �cg c]  }t9        |«      ‘Œ } }t;        | |xs |«      } t        j.                  j1                  | |¬«      j3                  «       S t        | d   t        j<                  «      r-t        j.                  j                  | «      j3                  «       S t;        | |«      } t?        | |«      }|�|j3                  «       S t        j.                  j1                  | «      j3                  «       S tA        | «      r¿t        | tB        jD                  «      r¥t?        | |«      }|€!t        j.                  jG                  | d¬	«      }|jH                  jJ                  �|jH                  jJ                  ni }|jM                  «       D ��ci c]  \  }}|d
k7  sŒ||“Œ }}}|jO                  |«      j3                  «       S t        | t        j.                  «      r| j3                  «       S t        | t        j<                  «      r+t        j                  j                  | jH                  | g«      S tQ        | «      r8t        | tR        jT                  «      r| jW                  «       j3                  «       S t        | t        jX                  j                  «      r| jW                  «       j3                  «       S t        | t        jX                  jZ                  «      r| j3                  «       S t        | t        j                  «      r| S t]        | «      j^                  ja                  d«      r7| j4                  jb                  dk(  r| je                  «       j3                  «       S t]        | «      j^                  ja                  d«      rE| j4                  jb                  dk(  r,| jg                  «       je                  «       j3                  «       S t        | th        «      rtk        | |«      S tm        dt]        | «      › d�«      ‚c c}w c c}}w )Nr   )Údatasetsrp   z6Cannot add a single LanceModel to a table. Use a list.zWCannot create or add rows from a single dictionary. Use a list of dictionaries instead.z4Cannot create table from empty list without a schema©r  Fr  s   pandasr1   r  Ú	LazyFramezUnknown data type z§. Supported types: list of dicts, pandas DataFrame, polars DataFrame, pyarrow Table/RecordBatch, or Pydantic models. See https://docs.lancedb.com/tables/ for examples.)7Úlancedb.dependenciesr'  r,   rn   ÚDatasetÚfeaturesÚarrow_schemar  ÚRecordBatchReaderÚfrom_batchesr   Údataset_dictÚDatasetDictÚ_schema_from_hfr  Úappendr  ÚstringÚ_to_batches_with_splitrG   ró   rô   r
  r°   r  Ú	to_readerÚ	__class__Úto_arrow_schemarH   Ú_serialize_json_valuesÚRecordBatchr%  r.   r  r  r  r  ÚmetadataÚitemsr  r-   r/   ÚLanceDatasetÚscannerÚdatasetÚScannerrû   rá   r�   rà   Úto_arrowÚcollectr   Ú_iterator_to_readerrú   )	rë   r  r'  Úmodel_schemaÚdr!  ÚmetaÚkÚvs	            rh   Ú_into_pyarrow_readerrI  â  se  € õ .ä˜tÔ$Ü�d˜H×,Ñ,Ô-Ø—]‘]×/Ñ/ˆFÜ×'Ñ'×4Ñ4°V¼[ÈÓ=NÓOÐOÜ˜˜h×3Ñ3×?Ñ?Ô@Ü$ T¨4Ó0ˆFØ˜fŸl™lÑ*ØŸ™¤r§x¡x°¼¿¹»Ó'EÓF�Ü×'Ñ'×4Ñ4ØÔ.¨tÓ4óð ô �$œ
Ô#ÜÐQÓRÐRä�$œÔÜð2ó
ð 	
ô
 �$œÕáØˆ~Ü Ð!WÓXÐXÜ—8‘8×'Ñ'¨°VÐ'Ó<×FÑFÓHÐHô �d˜1‘gœzÔ*Ø ™7×,Ñ,×<Ñ<Ó>ˆLØ.2Ö3¨”M !Õ$Ð3ˆDÐ3Ü)¨$°Ò0F¸,ÓGˆDÜ—8‘8×'Ñ'¨°\Ð'ÓB×LÑLÓNÐNÜ˜˜Q™¤§¡Ô0Ü—8‘8×(Ñ(¨Ó.×8Ñ8Ó:Ð:ä)¨$°Ó7ˆDÜ(¨¨vÓ6ˆEàÐ*�ß‰i‹kðÜ02·±×0DÑ0DÀTÓ0Jß‰i‹kðô 
˜4Ô	 ¤Z°´b·l±lÔ%CÜ$ T¨6Ó2ˆØˆ=Ü—H‘H×(Ñ(¨¸eÐ(ÓDˆEà(-¯©×(=Ñ(=Ð(Iˆu�|‰|×$Ò$ÈrˆØ!%§¡£×@™˜˜A°°i³��1‘Ð@ˆÑ@Ø×,Ñ,¨TÓ2×<Ñ<Ó>Ð>Ü	�Dœ"Ÿ(™(Ô	#Ø�~‰~ÓÐÜ	�Dœ"Ÿ.™.Ô	)Ü×#Ñ#×0Ñ0°·±¸t¸fÓEÐEÜ	˜$Ô	¤J¨t´U×5GÑ5GÔ$HØ�|‰|‹~×'Ñ'Ó)Ð)Ü	�Dœ"Ÿ*™*×,Ñ,Ô	-Ø�|‰|‹~×'Ñ'Ó)Ð)Ü	�Dœ"Ÿ*™*×,Ñ,Ô	-Ø�~‰~ÓÐÜ	�Dœ"×.Ñ.Ô	/ØˆäˆT‹
×Ñ×(Ñ(¨Ô2Ø�N‰N×#Ñ# {Ò2à�}‰}‹×(Ñ(Ó*Ð*äˆT‹
×Ñ×(Ñ(¨Ô2Ø�N‰N×#Ñ# {Ò2à�|‰|‹~×&Ñ&Ó(×2Ñ2Ó4Ð4Ü	�Dœ(Ô	#Ü" 4¨Ó0Ð0äØ ¤ d£ ð -Að Aó
ð 	
ùòY 4ùó" As   Æ:V4ÍV9ÍV9c                ó4  ‡ ‡‡— t        ‰ «      Š 	 t        ‰ «      }t        |«      Š‰j                  Šˆ ˆˆfd„}t        j
                  j                  ‰ |«       «      S # t        $ r0 ‰€t        d«      ‚t        j
                  j                  ‰g «      cY S w xY w)Nz8Cannot create table from empty iterable without a schemac               3  óT  •K  — ‰E d {  –—†  ‰D ]T  } t        | «      j                  «       }|j                  ‰k7  r	 |j                  ‰«      }|j                  «       E d {  –—†  ŒV y 7 Œ^# t        j
                  j                  $ r t        d‰› d| j                  › �«      ‚w xY w7 ŒE­w)NzfInput iterator yielded a batch with schema that does not match the schema of other batches.
Expected:
z
Got:
)	rI  Úread_allr  Úcastr  ÚlibÚArrowInvalidró   Ú
to_batches)Úbatchr!  rë   Úfirstr  s     €€€rh   Úgenz _iterator_to_reader.<locals>.genH  s±   øè ø€ Ø×ÐØò 	*ˆEÜ2°5Ó9×BÑBÓDˆEØ�|‰|˜vÒ%ðØ!ŸJ™J vÓ.�Eð ×'Ñ'Ó)×)Ñ)ñ	*ð 	ùô —v‘v×*Ñ*ò Ü$ð&à&, X¨X°e·l±l°^ðEóð ðúð *ús2   ƒB(‰A(Š1B(¼A*ÁB(Á B&Á!B(Á*9B#Â#B()	ÚiterÚnextÚStopIterationró   r  r.  r/  rI  r  )rë   r  Úfirst_batchrS  rR  s   ``  @rh   rC  rC  9  sŽ   ú€ ô
 �‹:€Dð=Ü˜4“jˆô
 ! Ó-€EØ�\‰\€Fö*ô ×Ñ×,Ñ,¨V±S³UÓ;Ð;øô- ò =Øˆ>ÜÐWÓXÐXÜ×#Ñ#×0Ñ0°¸Ó<Ò<ð=ús   �A Á6BÂB)Úallow_subschemac               óø   — t        | |«      }t        |||¬«      }t        |||||¬«      }|€t        |«      \  }}|r%|j	                  t        |j                  |«      «      }t        |«       t        |||«      }|S )a  
    Handle input data, applying all standard transformations.

    This includes:

     * Converting the data to a PyArrow Table
     * Adding vector columns defined in the metadata
     * Adding embedding metadata into the schema
     * Casting the table to the target schema
     * Handling bad vectors

    Parameters
    ----------
    target_schema : Optional[pa.Schema], default None
        The schema to cast the table to. This is typically the schema of the table
        if it already exists. Otherwise it might be a user-requested schema.
    allow_subschema : bool, default False
        If True, the input table is allowed to omit columns from the target schema.
        The target schema will be filtered to only include columns that are present
        in the input table before casting.
    metadata : Optional[dict], default None
        The embedding metadata to add to the schema.
    on_bad_vectors : Literal["error", "drop", "fill", "null"], default "error"
        How to handle vectors with incorrect sizes, NaNs, or null elements.
    fill_value : float, default 0.0
        The value to use when filling vectors. Only used if on_bad_vectors="fill".
        NaN or null elements and missing trailing elements are replaced with this
        value. Valid elements are preserved.
    ©r;  )Úon_bad_vectorsÚ
fill_valueÚtarget_schemar;  )	rI  Ú_append_vector_columnsÚ_handle_bad_vectorsÚ_infer_target_schemaÚwith_metadataÚ_merge_metadatar;  Ú_validate_schemaÚ_cast_to_target_schema)rë   r]  r;  r[  r\  rX  Úreaders          rh   Ú_sanitize_datarf  Z  s‘   € ôT " $¨Ó6€Fä# F¨MÀHÔM€Fô !ØØ%ØØ#Øô€Fð ÐÜ 4°VÓ <Ñˆ�váØ%×3Ñ3Ü˜M×2Ñ2°HÓ=ó
ˆô �]Ô#Ü# F¨M¸?ÓK€Fà€Mrj   c                ó€  ‡ ‡— ‰ j                   j                  |d¬«      r‰ S t        t        t	        ‰ j                   «      «      t        t	        |«      «      «      }t        j                   ||j                  ¬«      Š|s"t        ‰«      t        |«      k7  rt        d«      ‚|rrt        ‰«      t        |«      k7  r[t        t        t	        ‰ j                   «      «      t        t	        ‰«      «      «      }t        j                   ||j                  ¬«      Šˆ ˆfd„}t
        j                  j                  ‰ |«       «      S )NT©Úcheck_metadatarZ  z>Input table has different number of columns than target schemac               3  ó  •K  — ‰D ]~  } t        | ‰«      } t        j                  j                  | g«      j	                  ‰«      j                  «       }|sŒOt        j                  j                  |d   j                  ‰¬«      –— Œ€ y ­w)Nr   r(  )	Ú_coerce_blob_write_columnsr  r°   r/  rM  rP  r:  Úfrom_arraysr  )rQ  Úcast_batchesre  Úreordered_schemas     €€rh   rS  z#_cast_to_target_schema.<locals>.gen¹  s„   øè ø€ Øò 		ˆEÜ.¨uÐ6FÓGˆEô —‘×%Ñ% u gÓ.×3Ñ3Ð4DÓE×PÑPÓRð ò Ü—n‘n×0Ñ0Ø  ‘O×+Ñ+Ð4Dð 1ó ó ñ		ùs   ƒABÁ3B)r  ÚequalsÚ_align_field_typesr
  rT  r  r;  Úlenró   Ú_infer_subschemar.  r/  )re  r]  rX  ÚfieldsrS  rn  s   `    @rh   rd  rd     sü   ù€ ð ‡}�}×Ñ˜M¸$ÐÔ?àˆä¤¤T¨&¯-©-Ó%8Ó 9¼4ÄÀ]Ó@SÓ;TÓU€FÜ—y‘y °-×2HÑ2HÔIÐÙœsÐ#3Ó4¼¸MÓ8JÒJÜØLó
ð 	
ñ œ3Ð/Ó0´C¸Ó4FÒFÜ!Ü”�f—m‘mÓ$Ó%¤t¬DÐ1AÓ,BÓ'Có
ˆô Ÿ9™9 V°m×6LÑ6LÔMÐõ
ô ×Ñ×,Ñ,Ð-=¹s»uÓEÐErj   c                óø   — |D �ci c]  }|j                   |“Œ }}| D �cg c]+  }|j                   |v rt        |||j                      «      n|‘Œ- }}t        j                  || j                  ¬«      S c c}w c c}w )zKKeep inferred blob semantics without overriding explicit replacement types.rZ  )rù   Ú_preserve_blob_v2_fieldr  r  r;  )Úinferred_schemaÚexisting_schemar  Úexisting_fieldsrs  s        rh   Ú_preserve_blob_v2_fieldsry  È  sŒ   € ð 7FÖF¨U�u—z‘z 5Ñ(ÐF€OÐFð
 %ö	ð ð �:‰:˜Ñ(ô 	   °u·z±zÑ'BÔCàñ	ð€Fð ô �9‰9�V o×&>Ñ&>Ô?Ð?ùò Gùòs
   …A2Ÿ0A7c                ó2  — t        | «      r| S t        |«      r|S | j                  |j                  }}t        j                  j	                  |«      r“t        j                  j	                  |«      rt|D �ci c]  }|j
                  |“Œ }}|D �cg c]+  }|j
                  |v rt        |||j
                     «      n|‘Œ- }}| j                  t        j                  |«      «      S t        |«      rüt        |«      rñt        |j                  |j                  «      }||j                  k(  r| S |j                  |j                  j
                  «      }t        j                  j                  |«      r!t        j                  ||j                  «      }nJt        j                  j                  |«      rt        j                   |«      }nt        j                  |«      }| j                  |«      S t#        t        j$                  |g«      «      r|S | S c c}w c c}w r¨   )r`   rû   r  ÚtypesÚ	is_structrù   ru  Ú	with_typeÚstructÚ_is_list_likeÚvalue_fieldÚ	with_nameÚis_fixed_size_listÚlist_Ú	list_sizeÚis_large_listÚ
large_listr_   r  )	ÚinferredÚexistingÚinferred_typeÚexisting_typer  Úexisting_childrenÚchildrenr€  Ú
value_types	            rh   ru  ru  Ö  s¼  € Ü˜Ô!àˆÜ˜Ô!Øˆà#+§=¡=°(·-±-�=€MÜ	‡x�x×Ñ˜-Ô(¬R¯X©X×-?Ñ-?ÀÔ-NØ<IÖJ°5˜UŸZ™Z¨Ñ.ÐJÐÐJð
 'ö	
ð ð �z‰zÐ.Ñ.ô $ EÐ+<¸U¿Z¹ZÑ+HÔIàñð
ˆð 
ð ×!Ñ!¤"§)¡)¨HÓ"5Ó6Ð6ä�]Ô#¬°mÔ(DÜ-Ø×%Ñ% }×'@Ñ'@ó
ˆð ˜-×3Ñ3Ò3ØˆOØ!×+Ñ+¨M×,EÑ,E×,JÑ,JÓKˆÜ�8‰8×&Ñ& }Ô5ÜŸ™ +¨}×/FÑ/FÓG‰JÜ�X‰X×#Ñ# MÔ2ÜŸ™ {Ó3‰JäŸ™ +Ó.ˆJØ×!Ñ! *Ó-Ð-äœBŸI™I x jÓ1Ô2ØˆØ€Oùò5 Kùò
s   Á5HÂ0Hc                ó  — g }g }d}t        | j                  | j                  «      D ]–  \  }}|j                  |j                  «      }t        ||«      }||urD|}t        j                  |j                  |j                  |j                  |j                  «      }d}|j                  |«       |j                  |«       Œ˜ |s| S t        j                  j                  |t        j                  || j                  j                  ¬«      ¬«      S )zãMaterialize Python bytes and URIs as blob structs before Arrow casting.

    Existing blob structs retain their input layout. Rust normalizes them to
    the stored schema and rejects populated ranges on two-field targets.
    FTrZ  r(  )Úzipr  r  r  rù   Ú_coerce_blob_valuer  rû   Únullabler;  r3  r:  rl  )	rQ  r]  r  rs  Úchangedr  r$  Útarget_fieldÚcoerceds	            rh   rk  rk  ü  sí   € ð €GØ€FØ€GÜ˜UŸ\™\¨5¯=©=Ó9ò ‰ˆˆvØ$×*Ñ*¨5¯:©:Ó6ˆÜ$ V¨\Ó:ˆØ˜&Ñ ØˆFÜ—H‘HØ—
‘
Ø—‘Ø—‘Ø×%Ñ%ó	ˆEð ˆGØ�‰�vÔØ�‰�eÕðñ ØˆÜ�>‰>×%Ñ%ØœŸ	™	 &°5·<±<×3HÑ3HÔIð &ó ð rj   c           	     óÊ  ‡— t        |«      r!t        | j                  «      rt        | |«      S |j                  }t        j
                  j                  |«      �rSt        j
                  j                  | j                  «      �r)g }g }d}| j                  D ]Í  Š| j                  ‰j                  «      }t        ˆfd„|D «       d «      }|€#|j                  |«       |j                  ‰«       ŒXt        ||«      }||urd}t        |«      \  }	}
|j                  |	«       |j                  t	        j                  ‰j                  |
‰j                  |j                  «      «       ŒÏ |s| S t        j                  j!                  ||| j"                  r| j%                  «       ¬«      S d ¬«      S t'        |«      r+t'        | j                  «      rt)        | |j*                  «      S | S )NFc              3  óV   •K  — | ]   }|j                   ‰j                   k(  sŒ|–— Œ" y ­wr¨   ©rù   )rž   r  Úsource_fields     €rh   r¡   z%_coerce_blob_value.<locals>.<genexpr>(  s"   øè ø€ ÒS˜5°5·:±:À×ARÑARÓ3R”ÑSùó   ƒ)¢)T©rs  Úmask)r`   Ú_can_coerce_to_blobrû   Ú_coerce_value_to_blobr  r{  r|  r  rù   rU  r3  r�  Ú_physical_array_and_typer‘  r;  ÚStructArrayrl  Ú
null_countÚis_nullr  Ú_coerce_blob_list_valuesr€  )r$  r“  Útarget_typerŒ  rs  r’  Úsource_columnÚnested_targetr”  Úchild_arrayÚ
child_typer˜  s              @rh   r�  r�    s®  ø€ Ü˜Ô%Ô*=¸f¿k¹kÔ*JÜ$ V¨\Ó:Ð:à×#Ñ#€KÜ	‡x�x×Ñ˜+Õ&¬2¯8©8×+=Ñ+=¸f¿k¹kÕ+JØˆØˆØˆØ"ŸK™Kò 	ˆLØ"ŸL™L¨×):Ñ):Ó;ˆMÜ ÛS KÔSØóˆMð Ð$Ø—‘ Ô.Ø—‘˜lÔ+ØÜ(¨¸ÓFˆGØ˜mÑ+Ø�Ü&>¸wÓ&GÑ#ˆK˜Ø�O‰O˜KÔ(Ø�M‰MÜ—‘Ø ×%Ñ%ØØ ×)Ñ)Ø!×*Ñ*ó	õð	ñ. ØˆMÜ�~‰~×)Ñ)ØØØ%+×%6Ò%6�—‘Ó!ð *ó 
ð 	
ð =Að *ó 
ð 	
ô �[Ô!¤m°F·K±KÔ&@Ü'¨°×0GÑ0GÓHÐHà€Mrj   c                óÎ  — | j                   r| j                  «       nd}t        j                  j	                  | j
                  «      r�| j
                  j                  }| j                  j                  | j                  |z  t        | «      |z  «      }t        ||«      }||u r| S t        |«      \  }}t        j                  j                  |||¬«      S | j                  }|d   j!                  «       }	| j                  j                  |	|d   j!                  «       |	z
  «      }t        ||«      }||u r| S t        |«      \  }}|	r4t#        j$                  |t        j&                  |	|j
                  «      «      }t        j                  j)                  | j
                  «      r"t        j*                  j                  |||¬«      S t        j,                  j                  |||¬«      S )zêCoerce blob values inside a list column, preserving offsets and nulls.

    Works on the raw child values window instead of ``pc.list_flatten`` because
    flatten drops values spanned by null slots, which would misalign offsets.
    N)r›  r   éÿÿÿÿ)r   r¡  r  r{  r‚  rû   r„  r«   ÚsliceÚoffsetrq  r�  rž  ÚFixedSizeListArrayrl  ÚoffsetsÚas_pyÚpcÚsubtractÚscalarr…  ÚLargeListArrayÚ	ListArray)
r$  Útarget_value_fieldr›  r„  r«   r”  Úphysical_valuesÚ_r­  Úfirst_offsets
             rh   r¢  r¢  J  s“  € ð  &×0Ò0ˆ6�>‰>Ô°d€DÜ	‡x�x×"Ñ" 6§;¡;Ô/Ø—K‘K×)Ñ)ˆ	Ø—‘×$Ñ$ V§]¡]°YÑ%>ÄÀFÃÈiÑ@WÓXˆÜ$ VÐ-?Ó@ˆØ�fÑØˆMÜ5°gÓ>Ñˆ˜Ü×$Ñ$×0Ñ0°À)ÐRVÐ0ÓWÐWØ�n‰n€GØ˜1‘:×#Ñ#Ó%€LØ�]‰]× Ñ ØØ�‰×ÑÓ˜lÑ*ó€Fô ! Ð);Ó<€GØ�&ÑØˆÜ1°'Ó:Ñ€O�QÙÜ—+‘+˜g¤r§y¡y°¸w¿|¹|Ó'LÓMˆÜ	‡x�x×Ñ˜fŸk™kÔ*Ü× Ñ ×,Ñ,¨W°oÈDÐ,ÓQÐQÜ�<‰<×#Ñ# G¨_À4Ð#ÓHÐHrj   c                ón  — t        | j                  «      rdnd}t        | «      }|j                  }t        |t        j
                  «      r|j                  }t        |«      }g }|D ]À  }|j                  |k(  rt        j                  j                  | j                  «      sV| j                  |j                  k(  r|j                  | «       Œf|j                  | j                  |j                  «      «       Œ‘|j                  t	        j                  ||j                  ¬«      «       ŒÂ t        j                  j                  ||| j                   r| j                  «       nd ¬«      }t        |j                  t        j
                  «      r*t        j"                  j%                  |j                  |«      S |S )Nrì   rë   r	  rš  )Ú_is_string_likerû   rq  rn   r  r  r  r
  rù   r{  r¡  r3  rM  ÚnullsrŸ  rl  r   r  r  )	r«   r“  r€  Úlengthr  Ústorage_fieldsrŒ  Ústorage_fieldr#  s	            rh   r�  r�  l  sM  € Ü*¨6¯;©;Ô7‘%¸V€KÜ�‹[€FØ×$Ñ$€LÜ�,¤× 0Ñ 0Ô1Ø#×0Ñ0ˆÜ˜,Ó'€NØ€HØ'ò GˆØ×Ñ Ò,´R·X±X×5EÑ5EÀfÇkÁkÔ5RØ�{‰{˜m×0Ñ0Ò0Ø—‘ Õ'à—‘ §¡¨M×,>Ñ,>Ó ?Õ@à�O‰OœBŸH™H V°-×2DÑ2DÔEÕFðGô �n‰n×(Ñ(ØØØ!'×!2Ò!2ˆV�^‰^Ô¸ð )ó €Gô
 �,×#Ñ#¤R×%5Ñ%5Ô6Ü× Ñ ×-Ñ-¨l×.?Ñ.?ÀÓIÐIØ€Nrj   c                óª   — t        | j                  t        j                  «      r"| j                  | j                  j
                  fS | | j                  fS r¨   )rn   rû   r  r  r#  r  )r  s    rh   rž  rž  †  s>   € Ü�%—*‘*œb×.Ñ.Ô/Ø�}‰}˜eŸj™j×5Ñ5Ð5Ð5Ø�%—*‘*ÐÐrj   c                ót   — t        | «      xs, t        | «      xs t        j                  j	                  | «      S r¨   )Ú_is_binary_liker¹  r  r{  r¡  ©Ú	data_types    rh   rœ  rœ  Œ  s3   € ä˜	Ó"ò 	'Ü˜9Ó%ò	'ä�8‰8×Ñ˜IÓ&ðrj   c                óÄ   — t         j                  j                  | «      xs@ t         j                  j                  | «      xs t         j                  j	                  | «      S r¨   )r  r{  Ú	is_stringÚis_large_stringÚis_string_viewrÁ  s    rh   r¹  r¹  ”  óG   € ä
�‰×Ñ˜9Ó%ò 	.Ü�8‰8×#Ñ# IÓ.ò	.ä�8‰8×"Ñ" 9Ó-ðrj   c                óÄ   — t         j                  j                  | «      xs@ t         j                  j                  | «      xs t         j                  j	                  | «      S r¨   )r  r{  Ú	is_binaryÚis_large_binaryÚis_binary_viewrÁ  s    rh   rÀ  rÀ  œ  rÇ  rj   c                óä   — t        | j                  dd «      }|�|S | j                  xs i }|j                  d«      xs |j                  d«      }t	        |t
        «      r|j                  «       S |S )NÚextension_nameó   ARROW:extension:namezARROW:extension:name)r“   rû   r;  r  rn   rð   Údecode)r  rÍ  r;  s      rh   Ú_field_extension_namerÐ  ¤  sr   € Ü˜UŸZ™ZÐ)9¸4Ó@€NØÐ!ØÐà�~‰~Ò# €HØ—\‘\Ð"9Ó:ò ¸h¿l¹lØó?€Nô �.¤%Ô(Ø×$Ñ$Ó&Ð&ØÐrj   c                ó   — t        | «      dv S )N)ú
arrow.jsonú
lance.json)rÐ  )r  s    rh   Ú_is_json_fieldrÔ  ²  s   € Ü  Ó'Ð+GÐGÐGrj   T)Úfrozenc                  ó4   — e Zd ZU ded<   dZded<   dZded<   y)Ú_JsonSerializationPlanúpa.FieldÚarrow_fieldNz-Optional[Dict[str, '_JsonSerializationPlan']]rŒ  z"Optional['_JsonSerializationPlan']Úitem)rà   rá   râ   rä   rŒ  rÚ  re   rj   rh   r×  r×  ¶  s   … àÓØ>B€HÐ;ÓBØ/3€DÐ
,Ô3rj   r×  c                ó†  — t        | «      rt        | «      S t        j                  j	                  | j
                  «      r?i }| j
                  D ]  }t        |«      }|€Œ|||j                  <   Œ! |rt        | |¬«      S t        | j
                  «      r.t        | j
                  j                  «      }|�t        | |¬«      S y )N)rŒ  )rÚ  )
rÔ  r×  r  r{  r|  rû   Ú_json_serialization_planrù   r  r€  )r  rŒ  Úchild_fieldÚ
child_planÚ	item_plans        rh   rÜ  rÜ  ½  s«   € Ü�eÔÜ% eÓ,Ð,ä	‡x�x×Ñ˜%Ÿ*™*Ô%Ø68ˆØ Ÿ:™:ò 	8ˆKÜ1°+Ó>ˆJØÑ%Ø-7�˜×)Ñ)Ò*ð	8ñ Ü)¨%¸(ÔCÐCä�U—Z‘ZÔ Ü,¨U¯Z©Z×-CÑ-CÓDˆ	ØÐ Ü)¨%°iÔ@Ð@àrj   c                óR   — i }| D ]  }t        |«      }|€Œ|||j                  <   Œ! |S r¨   )rÜ  rù   )r  Úplansr  Úplans       rh   Ú_json_serialization_plansrã  Ò  s=   € ð 02€EØò %ˆÜ'¨Ó.ˆØÑØ $ˆE�%—*‘*Òð%ð €Lrj   c                ób  — | �t        | t        «      r| S t        |j                  «      r-t        | t        t
        f«      rt        j                  | «      S | S |j                  �ht        | t        «      rXd }|j                  j                  «       D ]3  \  }}|| vrŒt        | |   |«      }|| |   usŒ"|€t	        | «      }|||<   Œ5 |�|S | S |j                  �Xt        | t
        «      rHd }t        | «      D ]2  \  }}t        ||j                  «      }||usŒ!|€t        | «      }|||<   Œ4 |�|S | S | S r¨   )rn   ro   rÔ  rÙ  rô   r
  ÚjsonÚdumpsrŒ  r<  Ú_serialize_json_valuerÚ  Ú	enumerate)	rü   râ  Ú
serializedÚ
child_namerÞ  Úchild_valueÚindexrÚ  Úserialized_items	            rh   rç  rç  Ý  sJ  € Ø€}œ
 5¬#Ô.ØˆÜ�d×&Ñ&Ô'Ü�eœd¤D˜\Ô*Ü—:‘:˜eÓ$Ð$Øˆà‡}�}Ð ¤Z°´tÔ%<Øˆ
Ø&*§m¡m×&9Ñ&9Ó&;ò 	5Ñ"ˆJ˜
Ø Ñ&ØÜ/°°jÑ0AÀ:ÓNˆKØ %¨
Ñ"3Ò3ØÐ%Ü!% e£�JØ)4�
˜:Ò&ð	5ð (Ð3ˆzÐ>¸Ð>à‡y�yÐ¤¨E´4Ô!8Øˆ
Ü$ UÓ+ò 	4‰KˆE�4Ü3°D¸$¿)¹)ÓDˆOØ dÒ*ØÐ%Ü!% e£�JØ$3�
˜5Ò!ð	4ð (Ð3ˆzÐ>¸Ð>à€Lrj   c                ó\  — |�t        | t        «      s| S t        |«      }|s| S g }| D ]�  }t        |t        «      s|j	                  |«       Œ%d }|j                  «       D ]3  \  }}||vrŒt        ||   |«      }|||   usŒ"|€t        |«      }|||<   Œ5 |j	                  |�|n|«       Œƒ |S r¨   )rn   r
  rã  rô   r3  r<  rç  )	rë   r]  rá  Úserialized_rowsr  Úserialized_rowÚ
field_namerâ  rü   s	            rh   r9  r9  þ  sØ   € ØÐ¤J¨t´TÔ$:Øˆä% mÓ4€EÙØˆà€OØò VˆÜ˜#œtÔ$Ø×"Ñ" 3Ô'ØØˆØ %§¡£ò 	3ÑˆJ˜Ø Ñ$ØÜ)¨#¨j©/¸4Ó@ˆEØ˜C 
™OÒ+Ø!Ð)Ü%)¨#£Y�NØ-2�˜zÒ*ð	3ð 	×Ñ°Ð1K™~ÐQTÕUðVð Ðrj   c                ó°   ‡— g }| D ]M  Št        ˆfd„|D «       d«      }|€t        d‰j                  › d�«      ‚|j                  t	        ‰|«      «       ŒO |S )zD
    Apply the data types from the target_fields to the fields.
    c              3  óV   •K  — | ]   }|j                   ‰j                   k(  sŒ|–— Œ" y ­wr¨   r—  )rž   Úfr  s     €rh   r¡   z%_align_field_types.<locals>.<genexpr>!  s    øè ø€ ÒN 1¸¿¹À5Ç:Á:Ó9MœQÑNùr™  NzField 'z' not found in target schema)rU  ró   rù   r3  Ú_align_field)rs  Útarget_fieldsÚ
new_fieldsr“  r  s       @rh   rp  rp    sh   ø€ ð €JØò =ˆÜÓN¨ÔNÐPTÓUˆØÐÜ˜w u§z¡z lÐ2NÐOÓPÐPØ×Ñœ, u¨lÓ;Õ<ð	=ð
 Ðrj   c                óL   — t        | |«      j                  |j                  «      S r¨   )rõ  r�  rù   )ÚchildÚtarget_childs     rh   Ú_align_container_childrû  (  s"   € ô ˜˜|Ó,×6Ñ6°|×7HÑ7HÓIÐIrj   c                ó  — t         j                  j                  | «      st         j                  j                  | «      rt        j                  «       S t         j                  j                  | «      rt        j                  «       S y)zsThe storage type arrow.json would use for ``input_type``.

    Returns None if the type cannot hold JSON text.
    N)r  r{  rÄ  rÆ  r4  rÅ  Úlarge_string)Ú
input_types    rh   Ú_arrow_json_storage_typerÿ  .  sU   € ô
 
‡x�x×Ñ˜*Ô%¬¯©×)@Ñ)@ÀÔ)LÜ�y‰y‹{ÐÜ	‡x�x×Ñ 
Ô+Ü�‰Ó Ð Ørj   c                óÒ
  — t        |«      �r/| j                  }t        j                  j	                  |«      r+t        d„ |D «       «      sZt        d| j                  › d�«      ‚t        |«      s6t        |t        j                  «      st        d| j                  › d|› d�«      ‚t        j                  j	                  |«      s^t        |t        j                  «      r_t        |j                  t        j                  «      r t        |«      t        |j                  «      u r| j                  |j                  «      S t        |«      dk(  rqt        | «      dk(  r| S t        | j                  «      }|�Jt        |j                  xs i «      }d	|d
<   t        j                   | j                  || j"                  |«      S t        j                  j	                  |j                  «      r€t        j                  j	                  | j                  «      rIt        j$                  t'        | j                  j(                  |j                  j(                  «      «      }�nÝ|j                  }�nÏt        j                  j+                  |j                  «      rlt-        | j                  «      rIt        j.                  t1        | j                  j2                  |j                  j2                  «      «      }�nH|j                  }�n:t        j                  j5                  |j                  «      rlt-        | j                  «      rIt        j6                  t1        | j                  j2                  |j                  j2                  «      «      }�n³|j                  }�n¥t        j                  j9                  |j                  «      r€t-        | j                  «      r^t        j.                  t1        | j                  j2                  |j                  j2                  «      |j                  j:                  «      }�n	|j                  }nüt        j                  j=                  |j                  «      rÇt        j                  j=                  | j                  «      r‘t        j>                  t1        | j                  j@                  |j                  j@                  «      t1        | j                  jB                  |j                  jB                  «      |j                  jD                  ¬«      }n|j                  }n|j                  }t        j                   | j                  || j"                  |j                  «      S )Nc              3  ó8   K  — | ]  }|j                   d v –— Œ y­w))rë   rì   Nr—  )rž   rù  s     rh   r¡   z_align_field.<locals>.<genexpr>>  s   è ø€ ÒN¸�u—z‘z _Ô4ÑNùs   ‚zblob struct input for column 'z&' must contain a 'data' or 'uri' childzcannot coerce column 'z' with type zž into a blob v2 struct. expected binary bytes (Binary, LargeBinary, BinaryView), strings (Utf8, LargeUtf8, Utf8View), or a Struct with a 'data' or 'uri' childrÓ  rÒ  s
   arrow.jsonrÎ  )Úkeys_sorted)#r`   rû   r  r{  r|  r¢   ró   rù   rœ  rn   r  ra  r;  rÐ  rÿ  rô   r  r‘  r~  rp  rs  Úis_listr  rƒ  rû  r€  r…  r†  r‚  r„  Úis_mapÚmap_Ú	key_fieldÚ
item_fieldr  )r  r“  Úsource_typeÚjson_storager;  Únew_types         rh   rõ  rõ  :  sð  € Ü˜Õ%Ø—j‘jˆÜ�8‰8×Ñ˜kÔ*ÜÑNÀ+ÔNÔNÜ Ø4°U·Z±Z°Lð A.ð .óð ô % [Ô1¼*Øœ×)Ñ)ô;
ô Ø(¨¯©¨°LÀÀð N(ð (óð ô �8‰8×Ñ˜kÔ*Ü�{¤B×$4Ñ$4Ô5ä˜|×0Ñ0´"×2BÑ2BÔCÜ˜Ó$¬¨\×->Ñ->Ó(?Ñ?ð ×&Ñ& |×'<Ñ'<Ó=Ð=ô ˜\Ó*¨lÒ:Ü  Ó'¨<Ò7ØˆLô 0°·
±
Ó;ˆØÐ#ô ˜L×1Ñ1Ò7°RÓ8ˆHØ0=ˆHÐ,Ñ-Ü—8‘8˜EŸJ™J¨°e·n±nÀhÓOÐOÜ	‡x�x×Ñ˜,×+Ñ+Ô,Ü�8‰8×Ñ˜eŸj™jÔ)Ü—y‘yÜ"Ø—J‘J×%Ñ%Ø ×%Ñ%×,Ñ,óóŠHð $×(Ñ(ŠHÜ	�‰×	Ñ	˜,×+Ñ+Ô	,Ü˜Ÿ™Ô$Ü—x‘xÜ&Ø—J‘J×*Ñ*¨L×,=Ñ,=×,IÑ,IóóŠHð $×(Ñ(ŠHÜ	�‰×	Ñ	 × 1Ñ 1Ô	2Ü˜Ÿ™Ô$Ü—}‘}Ü&Ø—J‘J×*Ñ*¨L×,=Ñ,=×,IÑ,IóóŠHð $×(Ñ(ŠHÜ	�‰×	$Ñ	$ \×%6Ñ%6Ô	7Ü˜Ÿ™Ô$Ü—x‘xÜ&Ø—J‘J×*Ñ*¨L×,=Ñ,=×,IÑ,Ióð ×!Ñ!×+Ñ+ó	ŠHð $×(Ñ(‰HÜ	�‰�‰˜×*Ñ*Ô	+Ü�8‰8�?‰?˜5Ÿ:™:Ô&ô —w‘wÜ&Ø—J‘J×(Ñ(¨,×*;Ñ*;×*EÑ*Eóô 'Ø—J‘J×)Ñ)¨<×+<Ñ+<×+GÑ+Góð )×-Ñ-×9Ñ9ô‰Hð $×(Ñ(‰Hà×$Ñ$ˆÜ�8‰8�E—J‘J ¨%¯.©.¸,×:OÑ:OÓPÐPrj   c                ó"  — g }|D �ci c]  }|j                   |“Œ }}| D ]è  }|j                  |j                   «      }|€t        dj                  |«      «      ‚t        j
                  j                  |j                  «      rst	        j                  t        |j                  j                  |j                  j                  «      «      }t	        j                  |j                   ||j                  «      }n|}|j                  |«       Œê |S c c}w )zß
    Transform the list of fields so the types match the reference_fields.

    The order of the fields is preserved.

    ``schema`` may have fewer fields than `reference_fields`, but it may not have
    more fields.

    zUnexpected field in schema: {})rù   r  ró   Úformatr  r{  r|  rû   r~  rr  rs  r  r‘  r3  )	r  Úreference_fieldsrs  rô  Úlookupr  Ú	referencer
  Ú	new_fields	            rh   rr  rr  ¥  sê   € ð €FØ!1Ö2˜Aˆa�f‰f�a‰iÐ2€FÐ2Øò !ˆØ—J‘J˜uŸz™zÓ*ˆ	ØÐÜÐ=×DÑDÀUÓKÓLÐLä�8‰8×Ñ˜iŸn™nÔ-Ü—y‘yÜ Ø—J‘J×%Ñ%Ø—N‘N×)Ñ)óóˆHô Ÿ™Ø—
‘
ØØ×"Ñ"ó‰Ið "ˆIà�‰�iÕ ð)!ð, €Mùò/ 3s   ‡Dc                óŠ  — t        j                  |«      r t        |t        «      r|j	                  «       }| �-|€|�|j
                  }t        | ||||¬«      } | j                  }n#|�!t        j                  j                  g |¬«      } |€%| €t        d«      ‚t        | d«      r| j                  }|r�t        |j
                  |«      }|j                  |«      }t        | t        j                  «      r| j!                  |«      } | |fS t        | t        j"                  «      r t        j"                  j                  || «      } | |fS )N)r;  r[  r\  r(  z&Either data or schema must be providedr  )ÚinspectÚisclassÚ
issubclassrG   r8  r;  rf  r  r  r°   r/  ró   Úhasattrrb  ra  rn   r  r.  )rë   r  r;  r[  r\  s        rh   Úsanitize_create_tabler  Í  s0  € ô ‡��vÔ¤:¨f´jÔ#Að #×2Ñ2Ó4ˆàÐØÐ Ð 2Ø—‘ˆHÜØØØØ)Ø!ô
ˆð —‘‰àÐÜ—8‘8×(Ñ(¨°FÐ(Ó;ˆDØ€~Øˆ<ÜÐEÓFÐFÜ�T˜8Ô$Ø—[‘[ˆFáÜ" 6§?¡?°HÓ=ˆØ×%Ñ% hÓ/ˆä�dœBŸH™HÔ%Ø×/Ñ/°Ó9ˆDð �ˆ<Ðô ˜œb×2Ñ2Ô3Ü×'Ñ'×4Ñ4°V¸TÓBˆDà�ˆ<Ðrj   c                ó®   — | j                  «       D ]A  }|€|j                  j                  }Œ||j                  j                  k7  sŒ6d}t        |«      ‚ |S )z‚
    Extract pyarrow schema from HuggingFace DatasetDict
    and validate that they're all the same schema between
    splits
    zCAll datasets in a HuggingFace DatasetDict must have the same schema)r«   r,  r-  rú   )rë   r  r?  Úmsgs       rh   r2  r2  ú  sY   € ð —;‘;“=ò !ˆØˆ>Ø×%Ñ%×2Ñ2‰FØ�w×'Ñ'×4Ñ4Ó4ØWˆCÜ˜C“.Ð ð!ð €Mrj   c           
   #  óv  K  — | j                  «       D ]¢  \  }}t        |«      D ]�  }t        j                  j	                  |g«      }d|j
                  vrF|j                  dt        j                  |g|j                  z  t        j                  «       «      «      }|j                  «       D ]  }|–— Œ Œ‘ Œ¤ y­w)zm
    Return a generator of RecordBatches from a HuggingFace DatasetDict
    with an extra `split` column
    rp   N)r<  r   r  r°   r/  Úcolumn_namesÚappend_columnr  Únum_rowsr4  rP  )rë   Úkeyr?  rQ  r!  Úbs         rh   r5  r5  	  s©   è ø€ ð
 Ÿ
™
›ò ‰ˆˆWÜ  Ó)ò 	ˆEÜ—H‘H×)Ñ)¨5¨'Ó2ˆEØ˜e×0Ñ0Ñ0Ø×+Ñ+ØœRŸX™X s e¨e¯n©nÑ&<¼b¿i¹i»kÓJó�ð ×%Ñ%Ó'ò �Ø“ññ	ñùs   ‚B7B9rZ  c               óÒ  ‡ ‡‡	— ‰€t        |«      }nt        ‰j                  |«      }t        j                  «       j	                  |«      Š	‰	s‰ S t        ‰ j                  «      }‰	j                  «       D ]›  \  }}|‰ j                  j                  vsŒ‰�‰j                  |«      }nXt        j                  t        j                  «       |j                  j                  «       «      }t        j                  ||d¬«      }|j                  |«       Œ� t        j                  |‰ j                  j                  ¬«      Šˆ	ˆ ˆfd„}t        j                   j#                  ‰ |«       «      S )z{
    Use the embedding function to automatically embed the source columns and add the
    vector columns to the table.
    T)rû   r‘  rZ  c               3  ó<  •K  — ‰	D �]Œ  } ‰j                  «       D �]q  \  }}|j                  }|| j                  v}|s:t        j                  t        j
                  | |   «      «      j                  «       sŒ]|j                  | |j                     «      }|j                  j                  «       }|D �cg c]  }|�t        |«      |k(  r|nd ‘Œ }}|rQ| j                  ‰
j                  |«      t        j                  |‰
j                  |«      j                  ¬«      «      } �Œ	| j!                  | j                  j#                  |«      ‰
j                  |«      t        j                  |‰
j                  |«      j                  ¬«      «      } �Œt | –— �Œ� y c c}w ­w)Nr	  )r<  Úfunctionr  r¯  Úallr¡  r®  Ú$compute_source_embeddings_with_retryr¤  Úndimsrq  r  r  r  r  rû   r  rì  )rQ  Úvector_columnÚconfÚfuncÚno_vector_columnÚcol_dataÚexpected_ndimsrH  Ú	functionsre  r  s           €€€rh   rS  z#_append_vector_columns.<locals>.gen7  sn  øè ø€ Øó 	ˆEØ'0§¡Ó'8ó Ñ#�˜tØ—}‘}�Ø#0¸×8JÑ8JÐ#JÐ Ù#¤r§v¡v¬b¯j©j¸¸}Ñ9MÓ.NÓ'O×'UÑ'UÕ'WØ#×HÑHØ˜d×0Ñ0Ñ1ó �Hð &*§]¡]×%8Ñ%8Ó%:�Nð "*ö àð ˜]¬s°1«v¸Ò/G™ÈTÑQð �Hð  ñ (Ø %× 3Ñ 3Ø"ŸL™L¨Ó7ÜŸH™H X°F·L±LÀÓ4O×4TÑ4TÔUó!šð
 !&× 0Ñ 0Ø!×.Ñ.×4Ñ4°]ÓCØ"ŸL™L¨Ó7ÜŸH™H X°F·L±LÀÓ4O×4TÑ4TÔUó!šð/ð8 ŒKñ;	ùò ùs   ƒA3FÁ7<FÂ3FÃCF)rb  r;  r6   Úget_instanceÚparse_functionsr
  r  r<  r  r  r  rƒ  Úfloat32r!  r$  r3  r.  r/  )
re  r  r;  rs  r%  r&  r  ÚdtyperS  r+  s
   ``       @rh   r^  r^    s  ú€ ð €~Ü" 8Ó,‰ä" 6§?¡?°HÓ=ˆÜ)×6Ñ6Ó8×HÑHÈÓR€IáØˆä�&—-‘-Ó €FØ(Ÿ™Ó0ò !Ñˆ�tØ §¡× 3Ñ 3Ò3ØÐ!ØŸ™ ]Ó3‘äŸ™¤§¡£¨t¯}©}×/BÑ/BÓ/DÓE�ÜŸ™ °UÀTÔJ�Ø�M‰M˜%Õ ð!ô �Y‰Y�v¨¯©×(>Ñ(>Ô?€Föô@ ×Ñ×,Ñ,¨V±S³UÓ;Ð;rj   c                ó²   — t        | |«      }t        |«      }|j                  dk(  r|j                  d¬«      }|j                  d¬«      j	                  «       S )zˆ
    Get a table path that can be used in PyArrow FS.

    Removes any weird schemes (such as "s3+ddb") and drops any query params.
    zs3+ddbÚs3)ÚschemeN©Úquery)Ú
_table_urir   r2  Ú_replaceÚgeturl)ÚbaseÚ
table_namerì   Úparseds       rh   Ú_table_pathr;  Z  sO   € ô �T˜:Ó
&€Cä�c‹]€Fà‡}�}˜Ò Ø—‘¨�Ó-ˆà�?‰? ˆ?Ó&×-Ñ-Ó/Ð/rj   c                ó    — t        | |› d�«      S )Nz.lance)r\   )r8  r9  s     rh   r5  r5  j  s   € Ü�D˜Z˜L¨Ð/Ó0Ð0rj   c                óB   — | du rddl m}  |d¬«      dfS | du s| €y| dfS )z´Normalize a ``progress`` parameter for :meth:`Table.add`.

    Returns ``(progress_obj, owns)`` where *owns* is True when we created a
    tqdm bar that the caller must close.
    Tr   )Útqdmz rows)ÚunitF)NF)Ú	tqdm.autor>  )Úprogressr>  s     rh   Ú_normalize_progressrB  n  s9   € ð �4ÑÝ"á˜Ô! 4Ð'Ð'Ø�5Ñ˜HÐ,ØØ�Uˆ?Ðrj   c                  ón  — e Zd ZdZeedod„«       «       Zedpd„«       Zedod„«       Zeedqd„«       «       Z	eedrd„«       «       Z
eedsd„«       «       Zedtd„«       Zdud	„Zdqd
„Zeedvd„«       «       Zedwdxd„«       Zdydzd„Zeddœd{d„«       Zd|d„Zdwd}d„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d~d„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zed€d„«       Zedddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 d�d„«       Ze	 	 	 	 	 	 	 	 	 	 	 	 	 d‚dddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dƒd„«       Zdddedddddd d!d"d#fdddddd$œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d„d%„Zdddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 d…d&„Zd†d'„Z ed#¬(«      f	 	 	 	 	 d‡d)„Zedˆd*„«       Z edd+ddd,œ	 	 	 	 	 	 	 	 	 d‰d-„«       Z!dd.d/d.dd.d0d1d2dddddd3d3d.d4e"jF                  ddd5œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dŠd6„Z$e	 	 	 	 	 	 d‹	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dŒd7„«       Z%d�d8„Z&e	 	 	 	 	 	 dŽ	 	 	 	 	 	 	 	 	 	 	 	 	 d�d9„«       Z'ed.d:œ	 	 	 	 	 d�d;„«       Z(d‘d<„Z)ed.d:œ	 	 	 	 	 d’d=„«       Z*ed“d>„«       Z+e	 	 	 	 	 	 d”d?„«       Z,e	 	 	 	 	 	 d•d@„«       Z-e	 	 	 	 	 	 d–dA„«       Z.e	 	 	 	 d—dB„«       Z/d˜dC„Z0edddDœ	 	 	 	 	 	 	 d™dE„«       Z1edšd›dF„«       Z2edGdHœ	 	 	 	 	 dœdI„«       Z3ed�dJ„«       Z4e	 	 	 	 	 	 	 	 	 	 dždK„«       Z5edŸdL„«       Z6e	 	 d ddMœ	 	 	 	 	 	 	 d¡dN„«       Z7e	 dwd.dOœ	 	 	 	 	 d¢dP„«       Z8edQ„ «       Z9edd.d.ddRœ	 	 	 	 	 	 	 d£dS„«       Z:ed¤dT„«       Z;edddUœ	 	 	 	 	 	 	 d¥dV„«       Z<ed¦dW„«       Z=e	 dwddddXœ	 	 	 	 	 	 	 d§dY„«       Z>ed¨dZ„«       Z?ed©d[„«       Z@e	 	 	 dª	 	 	 	 	 	 	 d«d\„«       ZAed¬d]„«       ZBe	 	 	 	 d­d^„«       ZC eDjŠ                  d_eFd`¬a«      d®db„«       ZGed¯dc„«       ZHed°dd„«       ZIede„ «       ZJedwd±df„«       ZKed²dg„«       ZLeMdodh„«       ZNd³di„ZOdj„ ZPed´dk„«       ZQedl„ «       ZRd´dm„ZSdµdn„ZTy)¶r°   a&  
    A Table is a collection of Records in a LanceDB Database.

    Examples
    --------

    Create using [DBConnection.create_table][lancedb.DBConnection.create_table]
    (more examples in that method's documentation).

    >>> import lancedb
    >>> db = lancedb.connect("./.lancedb")
    >>> table = db.create_table("my_table", data=[{"vector": [1.1, 1.2], "b": 2}])
    >>> table.head()
    pyarrow.Table
    vector: fixed_size_list<item: float>[2]
      child 0, item: float
    b: int64
    ----
    vector: [[[1.1,1.2]]]
    b: [[2]]

    Can append new data with [Table.add()][lancedb.table.Table.add].

    >>> table.add([{"vector": [0.5, 1.3], "b": 4}])
    AddResult(version=2)

    Can query the table with [Table.search][lancedb.table.Table.search].

    >>> table.search([0.4, 0.4]).select(["b", "vector"]).to_pandas()
       b      vector  _distance
    0  4  [0.5, 1.3]       0.82
    1  2  [1.1, 1.2]       1.13

    Search queries are much faster when an index is created. See
    [Table.create_index][lancedb.table.Table.create_index].
    c                ó   — t        d«      ‚)zThe name of this Tablez)name is not supported for this table type©ÚNotImplementedError©Úselfs    rh   rù   z
Table.name£  s   € ô "Ð"MÓNÐNrj   c                ó   — g S )zFReturn the namespace path of the table (empty for the root namespace).re   rG  s    rh   Ú	namespacezTable.namespace©  s	   € ð ˆ	rj   c                óT   — dj                  | j                  | j                  gz   «      S )z9Return the full identifier of the table (namespace$name).ú$)rª   rJ  rù   rG  s    rh   ÚidzTable.id®  s"   € ð �x‰x˜Ÿ™¨$¯)©)¨Ñ4Ó5Ð5rj   c                ó   — t        d«      ‚)zThe version of this Tablez,version is not supported for this table typerE  rG  s    rh   ÚversionzTable.version³  s   € ô "Ð"PÓQÐQrj   c                ó   — t        d«      ‚)úlThe [Arrow Schema](https://arrow.apache.org/docs/python/api/datatypes.html#)
        of this Table

        z+schema is not supported for this table typerE  rG  s    rh   r  zTable.schema¹  s   € ô "Ð"OÓPÐPrj   c                ó   — t        d«      ‚)aW  Tag management for the table.

        Similar to Git, tags are a way to add metadata to a specific version of the
        table.

        .. warning::

            Tagged versions are exempted from the :py:meth:`cleanup_old_versions()`
            process.

            To remove a version that has been tagged, you must first
            :py:meth:`~Tags.delete` the associated tag.

        Examples
        --------

        .. code-block:: python

            table = db.open_table("my_table")
            table.tags.create("v2-prod-20250203", 10)

            tags = table.tags.list()

        z)tags is not supported for this table typerE  rG  s    rh   Útagsz
Table.tagsÂ  s   € ô6 "Ð"MÓNÐNrj   c                ó   — t        d«      ‚)ú¿Branch management for the table.

        Branches are isolated, writable lines of history forked from another
        branch (or version). Writes on a branch do not affect ``main``.
        z-branches is not supported for this table typerE  rG  s    rh   ÚbrancheszTable.branchesß  s   € ô "Ð"QÓRÐRrj   c                ó   — t        d«      ‚)úDThe branch this table handle is scoped to, or ``None`` for ``main``.z3current_branch is not supported for this table typerE  rG  s    rh   Úcurrent_branchzTable.current_branchè  s   € ä!Ð"WÓXÐXrj   c                ó$   — | j                  d«      S )z The number of rows in this TableN)Ú
count_rowsrG  s    rh   Ú__len__zTable.__len__ì  s   € à�‰˜tÓ$Ð$rj   c                 ó   — y)z^
        Get a mapping from vector column name to it's configured embedding function.
        Nre   rG  s    rh   Úembedding_functionszTable.embedding_functionsð  ó   � rj   Nc                ó   — t        d«      ‚)ú¹
        Count the number of rows in the table.

        Parameters
        ----------
        filter: str, optional
            A SQL where clause to filter the rows to count.
        z/count_rows is not supported for this table typerE  ©rH  Úfilters     rh   r[  zTable.count_rows÷  s   € ô "Ð"SÓTÐTrj   Úlazyc                óB   —  | j                  «       j                  di |¤ŽS )a~  Return the table as a pandas DataFrame.

        Parameters
        ----------
        blob_mode: str, default "lazy"
            Controls how blob columns are returned for backends that support
            Lance blob-aware pandas conversion.
        **kwargs
            Forwarded to PyArrow / Lance pandas conversion.

        Returns
        -------
        pd.DataFrame
        re   )rA  Ú	to_pandas)rH  Ú	blob_modeÚkwargss      rh   rf  zTable.to_pandas  s    € ð )ˆt�}‰}‹×(Ñ(Ñ2¨6Ñ2Ð2rj   ©rg  c               ó   — t        d«      ‚)áº  Return the table as a pyarrow Table.

        Parameters
        ----------
        blob_mode: str, default "lazy"
            ``"lazy"`` returns blob v2 descriptors that carry the row id
            ``fetch_blobs`` reads. ``"descriptions"`` returns them without it.
            ``"bytes"`` returns payload bytes and raises for legacy blob columns
            and blobs inside lists.

        Returns
        -------
        pa.Table
        z-to_arrow is not supported for this table typerE  ©rH  rg  s     rh   rA  zTable.to_arrow  s   € ô  "Ð"QÓRÐRrj   c                ó   — t        d«      ‚)a  Return a local table as a lance.LanceDataset.

        Remote tables cannot be opened as Lance datasets by the client. Use
        ``table.search().to_arrow()`` to read them through the server.

        Returns
        -------
        lance.LanceDataset
        z-to_lance is not supported for this table typerE  )rH  rh  s     rh   Úto_lancezTable.to_lance&  s   € ô "Ð"QÓRÐRrj   c                ó   — t        d«      ‚)am  Return the table as a Polars LazyFrame.

        For remote tables, use ``table.search().to_polars()`` to convert query
        results to a Polars DataFrame.

        Parameters
        ----------
        batch_size: int, optional
            Passed to Polars as the maximum row count for scanned PyArrow
            record batches.

        Note
        ----
        The Polars streaming engine is not supported because it does not currently
        implement Python PyArrow dataset scans. Use the default engine when collecting
        this LazyFrame.

        Returns
        -------
        polars.LazyFrame
        z.to_polars is not supported for this table typerE  )rH  rÓ   s     rh   Ú	to_polarszTable.to_polars2  s   € ô, "Ð"RÓSÐSrj   c                óz   — |�yt        d„ ||||fD «       «      ry|t        k7  ry|j                  «       t        v ryy)z-Detect if this is a legacy create_index call.Fc              3  ó$   K  — | ]  }|d u–— Œ
 y ­wr¨   re   )rž   Úxs     rh   r¡   z5Table._is_legacy_create_index_call.<locals>.<genexpr>Z  s   è ø€ ò 
àð �TŒMñ
ùs   ‚T)r¢   r4   ÚlowerÚKNOWN_METRICS)rH  Ú	first_argÚconfigÚnum_partitionsÚnum_sub_vectorsÚvector_column_namerx   Úindex_cache_sizes           rh   Ú_is_legacy_create_index_callz"Table._is_legacy_create_index_callJ  sZ   € ð ÐØô ñ 
à$ o°{ÐDTÐUô
ô 
ð ð Ô!3Ò3Øð �?‰?Ó¤Ñ-Øð rj   c                óf  — |dk(  rt        |||||
|¬«      S |dk(  rt        |||||
|¬«      S |dk(  rt        |||||||
|¬«      S |dk(  rt        ||||||
|¬«      S |dk(  rt	        ||||||||	|
|¬	«
      S |d
k(  rt        ||||||	|
|¬«      S |dk(  rt        ||||||	|
¬«      S t        d|› �«      ‚)z4Build an index config object from legacy parameters.ÚIVF_FLAT)Údistance_typerx  Úmax_iterationsÚsample_rateÚtarget_partition_sizerx   ÚIVF_SQÚIVF_PQ)r  rx  ry  Únum_bitsr€  r�  r‚  rx   ÚIVF_RQ)r  rx  r…  r€  r�  r‚  rx   ÚIVF_HNSW_PQ)
r  rx  ry  r…  r€  r�  ÚmÚef_constructionr‚  rx   ÚIVF_HNSW_SQ)r  rx  r€  r�  rˆ  r‰  r‚  rx   ÚIVF_HNSW_FLAT)r  rx  r€  r�  rˆ  r‰  r‚  úUnknown index type )r8   r:   r9   r<   r?   r@   rA   ró   )rH  ÚmetricÚ
index_typerx  ry  r…  r€  r�  rˆ  r‰  r‚  rx   s               rh   Ú'_build_vector_config_from_legacy_paramsz-Table._build_vector_config_from_legacy_paramsk  sT  € ð ˜Ò#ÜØ$Ø-Ø-Ø'Ø&;Ø'ôð ð ˜8Ò#ÜØ$Ø-Ø-Ø'Ø&;Ø'ôð ð ˜8Ò#ÜØ$Ø-Ø /Ø!Ø-Ø'Ø&;Ø'ô	ð 	ð ˜8Ò#ÜØ$Ø-Ø!Ø-Ø'Ø&;Ø'ôð ð ˜=Ò(ÜØ$Ø-Ø /Ø!Ø-Ø'ØØ /Ø&;Ø'ôð ð ˜=Ò(ÜØ$Ø-Ø-Ø'ØØ /Ø&;Ø'ô	ð 	ð ˜?Ò*ÜØ$Ø-Ø-Ø'ØØ /Ø&;ôð ô Ð2°:°,Ð?Ó@Ð@rj   c                ó0  — | dk(  rdddddddddddœ
S | d	k(  rd	dd ddddddddœ
S | d
k(  rd
dd ddddddddœ
S t        | «      dk7  rt        d| › �«      ‚| d d }| dd  dk7  rt        d| › �«      ‚|t        vrt        d|› �«      ‚dt        |   dddddddddœ
S )NÚdefaultÚsimpleÚEnglishé(   TFrƒ   )
r    r¥   Úmax_token_lengthÚ
lower_caseÚstemÚremove_stop_wordsÚascii_foldingÚngram_min_lengthÚngram_max_lengthÚprefix_onlyÚrawÚ
whitespaceé   zInvalid tokenizer name é   éûÿÿÿÚ_stemzInvalid language code )rq  ró   r^   )Útokenizer_nameÚlangs     rh   Úinfer_tokenizer_configszTable.infer_tokenizer_configsÆ  s0  € à˜YÒ&à"*Ø%Ø$&Ø"ØØ%*Ø!&Ø$%Ø$%Ø$ñð ð ˜uÒ$à"'Ø%Ø$(Ø#ØØ%*Ø!&Ø$%Ø$%Ø$ñð ð ˜|Ò+à".Ø%Ø$(Ø#ØØ%*Ø!&Ø$%Ø$%Ø$ñð ô ˆ~Ó !Ò#ÜÐ6°~Ð6FÐGÓHÐHØ˜b˜qÐ!ˆØ˜"˜#Ð 'Ò)ÜÐ6°~Ð6FÐGÓHÐHØ”|Ñ#ÜÐ5°d°VÐ<Ó=Ð=à&Ü$ TÑ*Ø "ØØØ!&Ø"Ø !Ø !Ø ñ
ð 	
rj   .©ÚreplaceÚwait_timeoutrù   Útrainc               ó   — y r¨   re   ©rH  r$  rw  r§  r¨  rù   r©  s          rh   Úcreate_indexzTable.create_index  ó   € ð rj   ©r¨  rù   r©  r‚  c                ó   — y r¨   re   ©rH  r�  rx  ry  rz  r§  rx   r{  r…  rŽ  r€  r�  rˆ  r‰  r¨  rù   r©  r‚  s                     rh   r¬  zTable.create_index  ó   € ð. rj   ræ   Té   r„  é2   é   é   é,  ©rw  r¨  rù   r©  r‚  c               ó   — t        d«      ‚)áë  Create an index on a column.

        This method supports both the new unified API and the legacy API
        for backwards compatibility. The new API takes the column name as the
        first positional argument and an index configuration object via
        ``config``; the legacy API takes the distance metric as the first
        argument plus separate ``vector_column_name`` / ``num_partitions`` /
        etc. parameters, and emits a ``DeprecationWarning``.

        Parameters
        ----------
        metric : str
            For new API: the column name to index.
            For legacy API: the distance metric ("l2", "cosine", "dot", "hamming").
        config : IndexConfigType, optional
            The index configuration object. If provided, uses the new unified API.
            Can be one of: IvfFlat, IvfPq, IvfSq, IvfRq, HnswPq, HnswSq,
            BTree, Bitmap, LabelList, Fm, FTS.
        replace : bool, default True
            Whether to replace an existing index on this column.
        wait_timeout : timedelta, optional
            Timeout to wait for async indexing to complete.
        name : str, optional
            Custom name for the index.
        train : bool, default True
            Whether to train the index with existing data.

        Examples
        --------
        New API (recommended):

        >>> table.create_index(  # doctest: +SKIP
        ...     "vector", config=IvfPq(distance_type="l2")
        ... )
        >>> table.create_index("category", config=BTree())  # doctest: +SKIP
        >>> table.create_index("content", config=FTS())  # doctest: +SKIP

        Legacy API (deprecated):

        >>> table.create_index(  # doctest: +SKIP
        ...     "l2", vector_column_name="vector"
        ... )
        z1create_index is not supported for this table typerE  )rH  r�  rx  ry  rz  r§  rx   r{  r…  rŽ  r€  r�  rˆ  r‰  rw  r¨  rù   r©  r‚  s                      rh   r¬  zTable.create_index-  s   € ôR "Ð"UÓVÐVrj   c               ó   — t        d«      ‚)a  Create an index, returning a handle to the indexing job.

        Takes the same arguments as :meth:`create_index`. The job may already
        be complete when returned; callers must not assume the index exists
        until :meth:`Job.wait` returns.
        z7create_index_async is not supported for this table typerE  r«  s          rh   Úcreate_index_asynczTable.create_index_asyncx  s   € ô  "ØEó
ð 	
rj   c                ó   — t        d«      ‚)aÙ  
        Drop an index from the table.

        Parameters
        ----------
        name: str
            The name of the index to drop.

        Notes
        -----
        This does not delete the index from disk, it just removes it from the table.
        To delete the index, run [optimize][lancedb.table.Table.optimize]
        after dropping the index.

        Use [list_indices][lancedb.table.Table.list_indices] to find the names of
        the indices.
        z/drop_index is not supported for this table typerE  ©rH  rù   s     rh   Ú
drop_indexzTable.drop_indexŒ  s   € ô$ "Ð"SÓTÐTrj   ©Úsecondsc                ó   — t        d«      ‚)á¬  
        Wait for indexing to complete for the given index names.
        This will poll the table until all the indices are fully indexed,
        or raise a timeout exception if the timeout is reached.

        Parameters
        ----------
        index_names: str
            The name of the indices to poll
        timeout: timedelta
            Timeout to wait for asynchronous indexing. The default is 5 minutes.
        z3wait_for_index is not supported for this table typerE  ©rH  Úindex_namesÚtimeouts      rh   Úwait_for_indexzTable.wait_for_index   s   € ô "Ð"WÓXÐXrj   c                ó   — t        d«      ‚)ú9
        Retrieve table and fragment statistics.
        z*stats is not supported for this table typerE  rG  s    rh   ÚstatszTable.stats±  s   € ô
 "Ð"NÓOÐOrj   ÚBTREE©r§  rŽ  r¨  rù   c               ó   — t        d«      ‚)a«	  Create a scalar index on a column.

        Parameters
        ----------
        column : str
            The column to be indexed.  Must be a boolean, integer, float,
            or string column.
        replace : bool, default True
            Replace the existing index if it exists.
        index_type: Literal["BTREE", "BITMAP", "LABEL_LIST"], default "BTREE"
            The type of index to create.
        wait_timeout: timedelta, optional
            The timeout to wait if indexing is asynchronous.
        name: str, optional
            The name of the index. If not provided, a default name will be generated.
        Examples
        --------

        Scalar indices, like vector indices, can be used to speed up scans.  A scalar
        index can speed up scans that contain filter expressions on the indexed column.
        For example, the following scan will be faster if the column ``my_col`` has
        a scalar index:

        >>> import lancedb # doctest: +SKIP
        >>> db = lancedb.connect("/data/lance") # doctest: +SKIP
        >>> img_table = db.open_table("images") # doctest: +SKIP
        >>> my_df = img_table.search().where("my_col = 7", # doctest: +SKIP
        ...                                  prefilter=True).to_pandas()

        Scalar indices can also speed up scans containing a vector search and a
        prefilter:

        >>> import lancedb # doctest: +SKIP
        >>> db = lancedb.connect("/data/lance") # doctest: +SKIP
        >>> img_table = db.open_table("images") # doctest: +SKIP
        >>> img_table.search([1, 2, 3, 4], vector_column_name="vector") # doctest: +SKIP
        ...     .where("my_col != 7", prefilter=True)
        ...     .to_pandas()

        Scalar indices can only speed up scans for basic filters using
        equality, comparison, range (e.g. ``my_col BETWEEN 0 AND 100``), and set
        membership (e.g. `my_col IN (0, 1, 2)`)

        Scalar indices can be used if the filter contains multiple indexed columns and
        the filter criteria are AND'd or OR'd together
        (e.g. ``my_col < 0 AND other_col> 100``)

        Scalar indices may be used if the filter contains non-indexed columns but,
        depending on the structure of the filter, they may not be usable.  For example,
        if the column ``not_indexed`` does not have a scalar index then the filter
        ``my_col = 0 OR not_indexed = 1`` will not be able to use any scalar index on
        ``my_col``.
        z8create_scalar_index is not supported for this table typerE  )rH  r$  r§  rŽ  r¨  rù   s         rh   Úcreate_scalar_indexzTable.create_scalar_index¸  s   € ô~ "ØFó
ð 	
rj   Fé   @r’  r“  r”  rƒ   é€   ©Úordering_field_namesr§  Úwriter_heap_sizeÚuse_tantivyr£  Úwith_positionr    r¥   r•  r–  r—  r˜  Úcustom_stop_wordsr™  rš  r›  rœ  Ú
block_sizeÚdocument_granularityr¨  rù   c               ó   — t        d«      ‚)u»  Create a full-text search index on the table.

        Warning - this API is highly experimental and is highly likely to change
        in the future.

        Parameters
        ----------
        field_names: str or list of str
            The name of the field to index. Native FTS indexes can only be
            created on a single field at a time. To search over multiple text
            fields, create a separate FTS index for each field.
        replace: bool, default False
            If True, replace the existing index if it exists. Note that this is
            not yet an atomic operation; the index will be temporarily
            unavailable while the new index is being created.
        writer_heap_size: int, default 1GB
            Deprecated legacy Tantivy parameter. Any value other than the
            default raises an error.
        ordering_field_names:
            Deprecated legacy Tantivy parameter. Setting this raises an error.
        tokenizer_name: str, default "default"
            A compatibility alias for native tokenizer configs. Can be "raw",
            "default" or the 2 letter language code followed by "_stem". So
            for english it would be "en_stem". For new native FTS indexes, use
            ``base_tokenizer`` directly; ``tokenizer_name`` is a legacy
            compatibility alias and does not expose model-backed tokenizer names
            such as ``jieba/default`` or ``lindera/ipadic``.
        use_tantivy: bool, default False
            Deprecated legacy Tantivy parameter. Setting this to True raises an
            error.
        with_position: bool, default False
            If False, do not store the positions of the terms in the text.
            This can reduce the size of the index and improve indexing speed.
            But it will raise an exception for phrase queries.
        base_tokenizer : str, default "simple"
            The base tokenizer to use for tokenization. Options are:
            - "simple": Splits text by whitespace and punctuation.
            - "whitespace": Split text by whitespace, but not punctuation.
            - "raw": No tokenization. The entire text is treated as a single token.
            - "code": Tokenizes source code and identifiers.
            - "ngram": N-Gram tokenizer.
            - "icu": ICU dictionary-based word segmentation.
            - "icu/split": ICU segmentation with simple-style delimiter splitting.
            - "jieba/*": Jieba tokenizer loaded from Lance's language model home.
            - "lindera/*": Lindera tokenizer loaded from Lance's language model home.
        language : str, default "English"
            The language to use for stemming and stop-word removal. This is not
            the primary way to enable CJK tokenization.
        max_token_length : int, default 40
            The maximum token length to index. Tokens longer than this length will be
            ignored.
        lower_case : bool, default True
            Whether to convert the token to lower case. This makes queries
            case-insensitive.
        stem : bool, optional
            Whether to stem the token. Stemming reduces words to their root form.
            For example, in English "running" and "runs" would both be reduced to "run".
            ``None`` uses the base tokenizer's default: False for ``code`` and
            ``ngram``, True otherwise.
        remove_stop_words : bool, optional
            Whether to remove stop words. Stop words are common words that are often
            removed from text before indexing. For example, in English "the" and "and".
            ``None`` uses the base tokenizer's default: False for ``code`` and
            ``ngram``, True otherwise.
        custom_stop_words : list of str, optional
            Custom words that replace the built-in language stop words. ``None``
            uses the built-in list; an empty list explicitly uses no stop words.
        ascii_folding : bool, default True
            Whether to fold ASCII characters. This converts accented characters to
            their ASCII equivalent. For example, "cafÃ©" would be converted to "cafe".
        ngram_min_length: int, default 3
            The minimum length of an n-gram.
        ngram_max_length: int, default 3
            The maximum length of an n-gram.
        prefix_only: bool, default False
            Whether to only index the prefix of the token for ngram tokenizer.
        block_size: int, default 128
            The number of documents per compressed posting block. Must be 128
            or 256. A value of 256 uses the experimental FTS V3 format and
            may introduce breaking changes.
        document_granularity: DocumentGranularity, default ROW
            ``ROW`` treats the selected text in one table row as one document.
            ``LIST_ELEMENT`` treats each element of the deepest list on the field
            path as one document and returns its physical coordinates in
            ``_doc_index`` for matching queries.
        wait_timeout: timedelta, optional
            The timeout to wait if indexing is asynchronous.
        name: str, optional
            The name of the index. If not provided, a default name will be generated.

        Notes
        -----
        Model-backed tokenizers such as ``jieba/default`` and ``lindera/ipadic``
        require tokenizer models in Lance's language model home. Set
        ``LANCE_LANGUAGE_MODEL_HOME`` to override the default platform data
        directory under ``lance/language_models``.
        z5create_fts_index is not supported for this table typerE  )rH  Úfield_namesrÑ  r§  rÒ  rÓ  r£  rÔ  r    r¥   r•  r–  r—  r˜  rÕ  r™  rš  r›  rœ  rÖ  r×  r¨  rù   s                          rh   Úcreate_fts_indexzTable.create_fts_indexû  s   € ôx "ØCó
ð 	
rj   c                ó   — t        d«      ‚)ad
  Add more data to the [Table][lancedb.table.Table].

        Parameters
        ----------
        data: DATA
            The data to insert into the table. Acceptable types are:

            - list-of-dict

            - pandas.DataFrame

            - pyarrow.Table or pyarrow.RecordBatch
        mode: str
            The mode to use when writing the data. Valid values are
            "append" and "overwrite". Overwrite adopts explicitly declared blob
            layouts, while inferred bytes retain the existing blob v2 fields.
        on_bad_vectors: str, default "error"
            How to handle vectors with incorrect sizes, NaNs, or null elements.
            One of "error", "drop", "fill", "null".
        fill_value: float, default 0.
            The value to use when filling vectors. Only used if on_bad_vectors="fill".
        progress: bool, callable, or tqdm-like, optional
            Progress reporting during the add operation. Can be:

            - ``True`` to automatically create and display a tqdm progress
              bar (requires ``tqdm`` to be installed)::

                table.add(data, progress=True)

            - A **callable** that receives a dict with keys ``output_rows``,
              ``output_bytes``, ``total_rows``, ``elapsed_seconds``,
              ``active_tasks``, ``total_tasks``, and ``done``::

                def on_progress(p):
                    print(f"{p['output_rows']}/{p['total_rows']} rows, "
                          f"{p['active_tasks']}/{p['total_tasks']} workers")
                table.add(data, progress=on_progress)

            - A **tqdm-compatible** progress bar whose ``total`` and
              ``update()`` will be called automatically. The postfix shows
              write throughput (MB/s) and active worker count::

                with tqdm() as pbar:
                    table.add(data, progress=pbar)

        write_parallelism: int, optional
            Number of partitions to write in parallel. Higher values increase
            throughput but also peak memory use, since each partition buffers
            data in flight. Defaults to an estimate based on the data size,
            capped at the number of CPU cores. Lower this if bulk ingestion is
            using too much memory.
        allow_external_blob_outside_bases: bool, default False
            Store blob URIs that sit outside registered blob bases. The row
            keeps a reference, so the object has to stay readable. Local
            tables only.

        Returns
        -------
        AddResult
            An object containing the new version number of the table after adding data.
        z(add is not supported for this table typerE  )rH  rë   Úmoder[  r\  rA  Úwrite_parallelismÚ!allow_external_blob_outside_basess           rh   Úaddz	Table.add{  s   € ôP "Ð"LÓMÐMrj   c                óh   — t        |t        «      r|gnt        t        |«      «      }t	        | |«      S ©a•
  
        Returns a [`LanceMergeInsertBuilder`][lancedb.merge.LanceMergeInsertBuilder]
        that can be used to create a "merge insert" operation

        This operation can add rows, update rows, and remove rows all in a single
        transaction. It is a very generic tool that can be used to create
        behaviors like "insert if not exists", "update or insert (i.e. upsert)",
        or even replace a portion of existing data with new data (e.g. replace
        all data where month="january")

        The merge insert operation works by combining new data from a
        **source table** with existing data in a **target table** by using a
        join.  There are three categories of records.

        "Matched" records are records that exist in both the source table and
        the target table. "Not matched" records exist only in the source table
        (e.g. these are new data) "Not matched by source" records exist only
        in the target table (this is old data)

        The builder returned by this method can be used to customize what
        should happen for each category of data.

        Please note that the data may appear to be reordered as part of this
        operation.  This is because updated rows will be deleted from the
        dataset and then reinserted at the end with the new values.

        Parameters
        ----------

        on: Union[str, Iterable[str]]
            A column (or columns) to join on.  This is how records from the
            source table and target table are matched.  Typically this is some
            kind of key or id column.  Passing several columns matches on the
            composite key: a source row updates a target row only when it
            agrees on every one of them.

        Examples
        --------
        >>> import lancedb
        >>> data = pa.table({"a": [2, 1, 3], "b": ["a", "b", "c"]})
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table", data)
        >>> new_data = pa.table({"a": [2, 3, 4], "b": ["x", "y", "z"]})
        >>> # Perform a "upsert" operation
        >>> res = table.merge_insert("a")     \
        ...      .when_matched_update_all()     \
        ...      .when_not_matched_insert_all() \
        ...      .execute(new_data)
        >>> res
        MergeResult(version=2, num_updated_rows=2, num_inserted_rows=1, num_deleted_rows=0, num_attempts=1, num_rows=3)
        >>> # The order of new rows is non-deterministic since we use
        >>> # a hash-join as part of this operation and so we sort here
        >>> table.to_arrow().sort_by("a").to_pandas()
           a  b
        0  1  b
        1  2  x
        2  3  y
        3  4  z
        ©rn   ro   r
  rT  rF   ©rH  Úons     rh   Úmerge_insertzTable.merge_insertÅ  ó,   € ôx   ¤CÔ(ˆb‰T¬d´4¸³8«nˆä& t¨RÓ0Ð0rj   c                ó   — t        d«      ‚)a¹  Create a search query to find the nearest neighbors
        of the given query vector. We currently support [vector search](https://lancedb.com/docs/search/vector-search/)
        and [full-text search](https://lancedb.com/docs/search/full-text-search/).

        All query options are defined in
        [LanceQueryBuilder][lancedb.query.LanceQueryBuilder].

        Examples
        --------
        >>> import lancedb
        >>> db = lancedb.connect("./.lancedb")
        >>> data = [
        ...    {"original_width": 100, "caption": "bar", "vector": [0.1, 2.3, 4.5]},
        ...    {"original_width": 2000, "caption": "foo",  "vector": [0.5, 3.4, 1.3]},
        ...    {"original_width": 3000, "caption": "test", "vector": [0.3, 6.2, 2.6]}
        ... ]
        >>> table = db.create_table("my_table", data)
        >>> query = [0.4, 1.4, 2.4]
        >>> (table.search(query)
        ...     .where("original_width > 1000", prefilter=True)
        ...     .select(["caption", "original_width", "vector"])
        ...     .limit(2)
        ...     .to_pandas())
          caption  original_width           vector  _distance
        0     foo            2000  [0.5, 3.4, 1.3]   5.220000
        1    test            3000  [0.3, 6.2, 2.6]  23.089996

        Parameters
        ----------
        query: list/np.ndarray/str/PIL.Image.Image, default None
            The targeted vector to search for.

            - *default None*.
            Acceptable types are: list, np.ndarray, PIL.Image.Image

            - If None then the select/where/limit clauses are applied to filter
            the table
        vector_column_name: str, optional
            The name of the vector column to search.

            The vector column needs to be a pyarrow fixed size list type

            - If not specified then the vector column is inferred from
            the table schema

            - If the table has multiple vector columns then the *vector_column_name*
            needs to be specified. Otherwise, an error is raised.
        query_type: str
            *default "auto"*.
            Acceptable types are: "vector", "fts", "hybrid", or "auto"

            - If "auto" then the query type is inferred from the query;

                - If `query` is a list/np.ndarray then the query type is
                "vector";

                - If `query` is a PIL.Image.Image then either do vector search,
                or raise an error if no corresponding embedding function is found.

            - If `query` is a string, then the query type is "vector" if the
            table has embedding functions else the query type is "fts"

        Returns
        -------
        LanceQueryBuilder
            A query builder object representing the query.
            Once executed, the query returns

            - selected columns

            - the vector

            - and also the "_distance" column which is the distance between the query
            vector and the returned vector.
        z+search is not supported for this table typerE  ©rH  r4  rz  Ú
query_typeÚordering_field_nameÚfts_columnsÚfast_searchs          rh   ÚsearchzTable.search	  s   € ôn "Ð"OÓPÐPrj   ©Úwith_row_idc                ó   — y)aö  
        Take a list of offsets from the table.

        Offsets are 0-indexed and relative to the current version of the table.  Offsets
        are not stable.  A row with an offset of N may have a different offset in a
        different version of the table (e.g. if an earlier row is deleted).

        Offsets are mostly useful for sampling as the set of all valid offsets is easily
        known in advance to be [0, len(table)).

        No guarantees are made regarding the order in which results are returned.
        Repeated offsets produce repeated rows, which makes this method suitable for
        sampling with replacement.

        Parameters
        ----------
        offsets: list[int]
            The offsets to take.
        with_row_id: bool, default False
            If True, include the "_rowid" column in the results.

        Returns
        -------
        LanceTakeQueryBuilder
            A query builder that can be executed to get the rows at the given
            offsets.
        Nre   )rH  r­  rï  s      rh   Útake_offsetszTable.take_offsets^	  r_  rj   c                óÄ  ‡— t        ‰«      }t        t        |«      «      }t        |ˆfd„¬«      }dg|z  }t        |«      D ]
  }||||   <   Œ | j                  j
                  }|j                  d«       | j                  ‰«      j                  |«      j                  «       j                  d«      j                  |«      j                  «       j                  dg«      }|S )a¡  
        Take a list of offsets from the table and return as a record batch.

        This method uses the `take_offsets` method to take the rows.  However, it
        aligns the offsets to the passed in offsets.  This means the return type
        is a record batch (and so users should take care not to pass in too many
        offsets)

        Note: this method is primarily intended to fulfill the Dataset contract
        for pytorch.

        Parameters
        ----------
        offsets: list[int]
            The offsets to take.

        Returns
        -------
        pa.RecordBatch
            A record batch containing the rows at the given offsets.
        c                ó   •— ‰|    S r¨   re   )Úidxr­  s    €rh   ú<lambda>z$Table.__getitems__.<locals>.<lambda>�	  s   ø€ °g¸c±l€ rj   )r  r   Ú
_rowoffset)rq  r
  Úrangerö   r  r  r3  rñ  ÚselectrA  Úsort_byÚtakeÚcombine_chunksÚdrop_columns)	rH  r­  Únum_offsetsÚindicesÚpermutationÚpermutation_invÚir  Útbls	    `       rh   Ú__getitems__zTable.__getitems__~	  sÇ   ø€ ô: ˜'“lˆÜ”u˜[Ó)Ó*ˆÜ˜WÓ*BÔCˆØ˜# Ñ+ˆÜ�{Ó#ò 	0ˆAØ./ˆO˜K¨™NÒ+ð	0ð —+‘+×#Ñ#ˆØ�‰�|Ô$à×Ñ˜gÓ&ß‰V�G‹_ß‰X‹Zß‰W�\Ó"ß‰T�/Ó"ß‰^Óß‰\˜<˜.Ó)ð 	ð ˆ
rj   c                ó   — y)aâ  
        Take a list of row ids from the table.

        Row ids are not stable and are relative to the current version of the table.
        They can change due to compaction and updates.

        No guarantees are made regarding the order in which results are returned.  If
        you desire an output order that matches the order of the given ids, you will
        need to add the row id column to the output and align it yourself.

        Unlike offsets, row ids are not 0-indexed and no assumptions should be made
        about the possible range of row ids.  In order to use this method you must
        first obtain the row ids by scanning or searching the table.

        Even so, row ids are more stable than offsets and can be useful in some
        situations.

        There is an ongoing effort to make row ids stable which is tracked at
        https://github.com/lancedb/lancedb/issues/1120

        Parameters
        ----------
        row_ids: list[int]
            The row ids to take.
        with_row_id: bool, default False
            If True, include the "_rowid" column in the results.

        Returns
        -------
        LanceTakeQueryBuilder
            A query builder that can be executed to get the rows.
        Nre   )rH  Úrow_idsrï  s      rh   Útake_row_idszTable.take_row_ids°	  r_  rj   c                 ó   — y)zÜNames of blob v1 and v2 columns that can be fetched by row id.

        Struct-nested blobs use dotted paths. Blobs inside lists are omitted
        because a row id does not identify an individual list element.
        Nre   rG  s    rh   Úblob_columnszTable.blob_columnsÕ	  r_  rj   c                 ó   — y)aÁ  Materialize full blob bytes for ``column`` at the given rows.

        Local tables support both legacy blob v1 and blob v2 columns.
        The result has the same length and order as ``row_ids``. Null blobs
        produce null slots; valid empty blobs produce ``b""``.

        ``row_ids`` may be a list, an integer Arrow array or chunked array,
        or a query table with row ids. ``_rowid`` values stay valid after
        compaction when the table has stable row ids.
        One missing or deleted row ID rejects the entire batch; no partial
        results are returned.

        Blobs inside lists cannot be fetched by row id yet.

        Remote servers limit each request to 1024 row IDs and 64 MiB of blob
        bytes. The client splits requests automatically and reads an individual
        larger blob through the Range route. This method still materializes all
        bytes in memory; for large values use :meth:`fetch_blob_files`.
        Nre   ©rH  r$  r  s      rh   Úfetch_blobszTable.fetch_blobsÝ	  r_  rj   c                 ó   — y)ae  Materialize row-specific byte ranges from a blob column.

        Local tables support both legacy blob v1 and blob v2 columns.
        Each request is a three-item ``(row_id, offset, length)`` sequence.
        Requests may be repeated or reordered, including multiple ranges for
        the same blob.
        The result has the same length and order as ``requests``; null blobs
        produce null slots and empty ranges on non-null blobs produce ``b""``.

        ``_rowid`` values stay valid after compaction when the table has stable
        row ids.
        One missing or deleted row ID rejects the entire batch; no partial
        results are returned.

        Row IDs can be obtained from a query with ``with_row_id(True)``.
        Remote tables read the requested ranges through version-pinned blob
        handles using HTTP byte-range requests.
        Nre   ©rH  r$  Úrequestss      rh   Úfetch_blob_rangeszTable.fetch_blob_ranges÷	  r_  rj   c                 ó   — y)aÖ  Open lazy, seekable :class:`~lancedb._blob.BlobFile` handles.

        Local tables support both legacy blob v1 and blob v2 columns.
        Prefer this over :meth:`fetch_blobs` for large payloads. ``row_ids`` is
        a ``list[int]``, an integer Arrow array or chunked array, or a query
        ``pyarrow.Table`` carrying row identity via ``_rowid`` or a
        ``_lance_row_id`` field on the blob descriptor. Null blob values return
        ``None``. Remote tables require LanceDB Cloud server 0.5.0 or newer.

        ``_rowid`` values stay valid after compaction when the table has stable
        row ids.
        One missing or deleted row ID rejects the entire batch; no partial
        handles are returned.
        Nre   r
  s      rh   Úfetch_blob_fileszTable.fetch_blob_files
  r_  rj   c                 ó   — y)aÌ  Open a seekable file from a SQL ``blob_descriptor`` result.

        Accepts the descriptor dictionary or an Arrow struct scalar. Its source
        pins the table version, branch, column and row identity, so opening does
        not change this table's checkout. Null descriptors return ``None``.
        Payload bytes load only when the returned handle is read. An external
        blob with an unspecified size may require a metadata request on opening.

        ```python
        rows = db.execute_query(
            "SELECT blob_descriptor(video) AS video FROM videos"
        ).read_all()
        with videos.open_blob_file(rows["video"][0]) as video:
            header = video.read(4096)
        ```
        Nre   ©rH  Ú
descriptors     rh   Úopen_blob_filezTable.open_blob_file%
  r_  rj   c              #  ó@   K  — |D ]  }| j                  |«      –— Œ y­w)a  Iterate over lazy files from descriptor dictionaries or Arrow scalars.

        Accepts an Arrow array/chunked array or any iterable. Opens each handle
        as iteration advances, preserving input order and nulls as ``None``.
        Close each non-null handle after use, normally with a ``with`` block.

        ```python
        for video in videos.open_blob_files(rows["video"]):
            if video is not None:
                with video:
                    header = video.read(4096)
        ```
        N©r  ©rH  Údescriptorsr  s      rh   Úopen_blob_fileszTable.open_blob_files:
  s(   è ø€ ð &ò 	2ˆJØ×%Ñ% jÓ1Ó1ñ	2ùs   ‚©rÓ   rÅ  c                ó   — y r¨   re   )rH  r4  rÓ   rÅ  s       rh   Ú_execute_queryzTable._execute_queryK
  s   € ð  #rj   c                 ó   — y r¨   re   ©rH  r4  Úverboses      rh   Ú_explain_planzTable._explain_planT
  s   € ØSVrj   Ú	aggregate©Údistributed_metricsc                ó   — y r¨   re   ©rH  r4  r$  s      rh   Ú_analyze_planzTable._analyze_planW
  s   € ð rj   c                 ó   — y r¨   re   ©rH  r4  s     rh   Ú_output_schemazTable._output_schema_
  s   € Ø9<rj   c                 ó   — y r¨   re   ©rH  ÚmergeÚnew_datar[  r\  s        rh   Ú	_do_mergezTable._do_mergeb
  s   € ð rj   c                ó   — t        d«      ‚)aÑ  Delete rows from the table.

        This can be used to delete a single row, many rows, all rows, or
        sometimes no rows (if your predicate matches nothing).

        Parameters
        ----------
        where: str or :class:`~lancedb.expr.Expr`
            The filter condition. Can be a SQL string or a type-safe
            :class:`~lancedb.expr.Expr` built with :func:`~lancedb.expr.col`
            and :func:`~lancedb.expr.lit`.

            The filter must not be empty, or it will error.

        Returns
        -------
        DeleteResult
            An object containing the new version number of the table after deletion.

        Examples
        --------
        >>> import lancedb
        >>> data = [
        ...    {"x": 1, "vector": [1.0, 2]},
        ...    {"x": 2, "vector": [3.0, 4]},
        ...    {"x": 3, "vector": [5.0, 6]}
        ... ]
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table", data)
        >>> table.to_pandas()
           x      vector
        0  1  [1.0, 2.0]
        1  2  [3.0, 4.0]
        2  3  [5.0, 6.0]
        >>> table.delete("x = 2")
        DeleteResult(num_deleted_rows=1, version=2)
        >>> table.to_pandas()
           x      vector
        0  1  [1.0, 2.0]
        1  3  [5.0, 6.0]

        If you have a list of values to delete, you can combine them into a
        stringified list and use the `IN` operator:

        >>> to_remove = [1, 5]
        >>> to_remove = ", ".join([str(v) for v in to_remove])
        >>> to_remove
        '1, 5'
        >>> table.delete(f"x IN ({to_remove})")
        DeleteResult(num_deleted_rows=1, version=3)
        >>> table.to_pandas()
           x      vector
        0  3  [5.0, 6.0]
        z+delete is not supported for this table typerE  )rH  Úwheres     rh   ÚdeletezTable.deletek
  s   € ôp "Ð"OÓPÐPrj   ©Ú
values_sqlc               ó   — t        d«      ‚)ad  
        This can be used to update zero to all rows depending on how many
        rows match the where clause. If no where clause is provided, then
        all rows will be updated.

        Either `values` or `values_sql` must be provided. You cannot provide
        both.

        Parameters
        ----------
        where: str or [Expr][lancedb.expr.Expr], optional
            The filter condition. Can be a SQL string or a type-safe
            [Expr][lancedb.expr.Expr] built with [col][lancedb.expr.col] and
            [lit][lancedb.expr.lit]. The filter must not be empty, or it will
            error.
        values: dict, optional
            The values to update. The keys are the column names and the values
            are the values to set.
        values_sql: dict, optional
            The values to update, expressed as SQL expression strings. These can
            reference existing columns. For example, {"x": "x + 1"} will increment
            the x column by 1.

        Returns
        -------
        UpdateResult
            - rows_updated: The number of rows that were updated
            - version: The new version number of the table after the update

        Examples
        --------
        >>> import lancedb
        >>> from lancedb.expr import col
        >>> import pandas as pd
        >>> data = pd.DataFrame({"x": [1, 2, 3], "vector": [[1.0, 2], [3, 4], [5, 6]]})
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table", data)
        >>> table.to_pandas()
           x      vector
        0  1  [1.0, 2.0]
        1  2  [3.0, 4.0]
        2  3  [5.0, 6.0]
        >>> table.update(where=col("x") == 2, values={"vector": [10.0, 10]})
        UpdateResult(rows_updated=1, version=2)
        >>> table.to_pandas()
           x        vector
        0  1    [1.0, 2.0]
        1  3    [5.0, 6.0]
        2  2  [10.0, 10.0]
        >>> table.update(values_sql={"x": "x + 1"})
        UpdateResult(rows_updated=3, version=3)
        >>> table.to_pandas()
           x        vector
        0  2    [1.0, 2.0]
        1  4    [5.0, 6.0]
        2  3  [10.0, 10.0]
        z+update is not supported for this table typerE  ©rH  r1  r«   r4  s       rh   ÚupdatezTable.update¥
  s   € ôB "Ð"OÓPÐPrj   ©Údelete_unverifiedc                ó   — y)aT  
        Clean up old versions of the table, freeing disk space.

        Parameters
        ----------
        older_than: timedelta, default None
            The minimum age of the version to delete. If None, then this defaults
            to two weeks.
        delete_unverified: bool, default False
            Because they may be part of an in-progress transaction, files newer
            than 7 days old are not deleted by default. If you are sure that
            there are no in-progress transactions, then you can set this to True
            to delete all files older than `older_than`.

        Returns
        -------
        CleanupStats
            The stats of the cleanup operation, including how many bytes were
            freed.

        See Also
        --------
        [Table.optimize][lancedb.table.Table.optimize]: A more comprehensive
            optimization operation that includes cleanup as well as other operations.

        Notes
        -----
        This function is not available in LanceDb Cloud (since LanceDB
        Cloud manages cleanup for you automatically)
        Nre   ©rH  Ú
older_thanr9  s      rh   Úcleanup_old_versionszTable.cleanup_old_versionsè
  r_  rj   c                 ó   — y)až  
        Run the compaction process on the table.
        This can be run after making several small appends to optimize the table
        for faster reads.

        Arguments are passed onto Lance's
        `lance.dataset.DatasetOptimizer.compact_files`.
        For most cases, the default should be fine.

        See Also
        --------
        [Table.optimize][lancedb.table.Table.optimize]: A more comprehensive
            optimization operation that includes cleanup as well as other operations.

        Notes
        -----
        This function is not available in LanceDB Cloud (since LanceDB
        Cloud manages compaction for you automatically)
        Nre   )rH  r”   rh  s      rh   Úcompact_fileszTable.compact_files  r_  rj   ©rŒ   r9  r�   Úcompaction_optionsc                ó   — y©a¨	  
        Optimize the on-disk data and indices for better performance.

        Modeled after ``VACUUM`` in PostgreSQL.

        Optimization covers three operations:

         * Compaction: Merges small files into larger ones
         * Prune: Removes old versions of the dataset
         * Index: Optimizes the indices, adding new data to existing indices

        Parameters
        ----------
        cleanup_older_than: timedelta, optional default 7 days
            All files belonging to versions older than this will be removed.  Set
            to 0 days to remove all versions except the latest.  The latest version
            is never removed.

            .. warning::

                Setting this to 0 deletes the data files of every older
                version, so any other reader or writer still using an older
                version of the table will fail. Only set it to 0 if no other
                process is working on this dataset.
        delete_unverified: bool, default False
            Files leftover from a failed transaction may appear to be part of an
            in-progress operation (e.g. appending new data) and these files will not
            be deleted unless they are at least 7 days old. If delete_unverified is True
            then these files will be deleted regardless of their age.

            .. warning::

                This should only be set to True if you can guarantee that no other
                process is currently working on this dataset. Otherwise the dataset
                could be put into a corrupted state.

        retrain: bool, default False
            This parameter is no longer used and is deprecated.
        compaction_options: CompactionOptions, optional
            Options that control file compaction. For large rows, derive a lower
            ``target_rows_per_fragment`` from the expected row size to bound later
            passes. This does not cap the first pass over an existing oversized
            fragment; see [CompactionOptions][lancedb.table.CompactionOptions].

        Notes
        -----
        The frequency an application should call optimize is based on the frequency of
        data modifications.  If data is frequently added, deleted, or updated then
        optimize should be run frequently.  A good rule of thumb is to run optimize if
        you have added or modified 100,000 or more records or run more than 20 data
        modification operations.
        Nre   ©rH  rŒ   r9  r�   rA  s        rh   ÚoptimizezTable.optimize$  r_  rj   c                 ó   — y)z}
        List all indices that have been created with
        [Table.create_index][lancedb.table.Table.create_index]
        Nre   rG  s    rh   Úlist_indiceszTable.list_indicesb  r_  rj   ©r$  Ú
index_namec                ó   — y)á‘  
        Tokenize a query using the tokenizer configured on an FTS index.

        Specify exactly one of ``column`` or ``index_name``.

        Model-backed tokenizers such as ``jieba/*`` and ``lindera/*`` are
        rebuilt in the client process from index metadata. For remote tables,
        this means the same tokenizer model files must also exist locally
        (under ``LANCE_LANGUAGE_MODEL_HOME``) and must match the files the
        server uses. A mismatch cannot be detected: the returned tokens may
        differ from what the server's index produces. If the model files are
        missing, an error naming the tokenizer is raised.
        Nre   ©rH  r4  r$  rI  s       rh   ÚtokenizezTable.tokenizei  r_  rj   c                 ó   — y)áG  
        Retrieve statistics about an index

        Parameters
        ----------
        index_name: str
            The name of the index to retrieve statistics for

        Returns
        -------
        IndexStatistics or None
            The statistics about the index. Returns None if the index does not exist.
        Nre   ©rH  rI  s     rh   Úindex_statszTable.index_stats  r_  rj   ©ÚcomputedÚauto_refresh_enabledÚauto_refresh_interval_secondsc                ó   — y)aœ  
        Add new columns with defined values.

        Parameters
        ----------
        transforms: Dict[str, str | FunctionApplication], FunctionApplication,
            pa.Field, List[pa.Field], pa.Schema
            A map of column name to a SQL expression to use to calculate the
            value of the new column. These expressions will be evaluated for
            each row in the table, and can reference existing columns.
            Alternatively, a pyarrow Field or Schema can be provided to add
            new columns with the specified data types. The new columns will
            be initialized with null values.

            A mapping with one ``FunctionApplication`` value keeps its scalar
            or named-struct result in the named table column. A bare
            named-struct application expands its ordered result fields as one
            atomic binding; aliases come from ``rename(columns=...)``.
            Function columns are supported only on LanceDB Cloud and
            Enterprise.
        computed: Dict[str, str], optional
            Local declaration and refresh require a source build with the
            ``experimental-functions`` Cargo feature, which published packages
            do not enable. Remote Cloud/Enterprise operations remain available.

            A mapping from output column names to SQL expressions derives each
            output field from its expression. A direct projection of a Blob v2
            field inherits Blob v2 semantics; other expressions derive their
            ordinary Arrow type. Mapping order is declaration and dependency
            order.

            Unlike ``transforms``, the expression is stored rather than
            evaluated now: the column is committed with no values, and rows get
            them from [`refresh_column`][lancedb.table.Table.refresh_column].
            Declaring one therefore costs the same on a large table as on an
            empty one.

            A refresh also recomputes the rows whose inputs changed since they
            were computed, so a mutated input is reflected by the next refresh.
            While a declaration reads a column, that column cannot be renamed,
            retyped or dropped.

            On LanceDB Cloud and Enterprise the expression is planned by the
            server, and the refresh runs as a server job -- see
            [`refresh_column_async`][lancedb.table.Table.refresh_column_async].
            Cannot be combined with ``transforms``.

        auto_refresh_enabled: bool, optional
            Enable automatic refresh for each declared computed output. Defaults
            to True. Local tables store this option; scheduling requires a server.
        auto_refresh_interval_seconds: int, optional
            Positive minimum interval after a successful refresh, in seconds.
            When omitted, the server determines when to refresh. Applies to every
            computed output in this call.
            Scheduling options require computed or Function columns.

        Returns
        -------
        AddColumnsResult
            version: the new version number of the table after adding columns.

        Examples
        --------
        >>> import lancedb
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("computed_demo", [{"x": 1}, {"x": 2}])
        >>> table.add_columns(computed={"doubled": "x * 2"})  # doctest: +SKIP
        AddColumnsResult(version=2)
        >>> table.refresh_column("doubled")  # doctest: +SKIP
        RefreshColumnResult(rows_filled=2, version=4)
        >>> table.to_arrow().sort_by("x").to_pandas()  # doctest: +SKIP
           x  doubled
        0  1        2
        1  2        4
        Nre   ©rH  Ú
transformsrS  rT  rU  s        rh   Úadd_columnszTable.add_columns�  r_  rj   c                 ó   — y)a»  
        Fill the rows of a computed column that hold no value yet.

        Local refresh requires the ``experimental-functions`` Cargo feature
        in a source build. Published packages leave it disabled.

        Declared with ``add_columns(computed=...)``, a column starts empty and
        gets its values here. Rows appended since the last refresh are filled
        by the next one, and rows whose inputs changed since they were computed
        are recomputed; everything else is left as it is.

        Local tables only: a remote refresh runs as a server job, through
        [`refresh_column_async`][lancedb.table.Table.refresh_column_async].

        Parameters
        ----------
        column: str
            The name of the computed column to fill.

        Returns
        -------
        RefreshColumnResult
            rows_filled: the number of rows given a value.
            version: the new version number of the table.
        Nre   ©rH  r$  s     rh   Úrefresh_columnzTable.refresh_columné  r_  rj   c                 ó   — y)at  
        Like :meth:`refresh_column`, but returns a handle to the refresh job
        instead of blocking until it completes.

        Local refresh requires a source build with ``experimental-functions``.
        Remote Cloud/Enterprise jobs do not require this feature.

        The job may already be complete when returned; callers must not assume
        the column is filled until :meth:`Job.wait` returns. Invalid input --
        an unknown column, or one that is not computed -- raises here rather
        than failing the job. On local tables the job runs in-process; on
        LanceDB Cloud and Enterprise it is the server's backfill job.

        Returns
        -------
        Job[RefreshColumnResult]
            A job whose successful ``wait`` returns row counts plus the source
            and published table versions.

        Examples
        --------
        >>> import lancedb
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("computed_job_demo", [{"x": 1}, {"x": 2}])
        >>> table.add_columns(computed={"doubled": "x * 2"})  # doctest: +SKIP
        AddColumnsResult(version=2)
        >>> job = table.refresh_column_async("doubled")  # doctest: +SKIP
        >>> result = job.wait()  # doctest: +SKIP
        >>> result.rows_assigned  # doctest: +SKIP
        2
        >>> job.status()  # doctest: +SKIP
        'finished'
        Nre   r[  s     rh   Úrefresh_column_asynczTable.refresh_column_async  r_  rj   c                 ó   — y)a  
        The per-row errors Function refreshes recorded on this table.

        A refresh running under a skip policy records each row it skipped
        with the input that failed and the error. This lists those records,
        newest job first, plus a summary for any fragment whose per-row
        detail was capped. LanceDB Cloud and Enterprise only; reading errors
        needs read access to the table, since a message carries the value
        that failed.

        Parameters
        ----------
        job_id: str, optional
            Only errors recorded by this job.
        column: str, optional
            Only errors on this column.
        limit: int, optional
            At most this many records (server default 10000, cap 100000).

        Returns
        -------
        FunctionErrors
            ``records``, ``fragments`` and ``truncated``, the last saying
            whether the listing stopped at its limit.

        Examples
        --------
        >>> errors = table.function_errors(column="embedding")  # doctest: +SKIP
        >>> for record in errors.records:  # doctest: +SKIP
        ...     print(record.job_id, record.row_offset, record.error_message)
        >>> if errors.truncated:  # doctest: +SKIP
        ...     print("listing stopped at the limit")
        Nre   ©rH  Újob_idr$  Úlimits       rh   Úfunction_errorszTable.function_errors)  r_  rj   c                 ó   — y)a¸  
        Alter column names and nullability.

        Parameters
        ----------
        alterations : Iterable[Dict[str, Any]]
            A sequence of dictionaries, each with the following keys:
            - "path": str
                The column path to alter. For a top-level column, this is the name.
                For a nested column, this is the dot-separated path, e.g. "a.b.c".
            - "rename": str, optional
                The new name of the column. If not specified, the column name is
                not changed.
            - "data_type": pyarrow.DataType, optional
               The new data type of the column. Existing values will be casted
               to this type. If not specified, the column data type is not changed.
            - "nullable": bool, optional
                Whether the column should be nullable. If not specified, the column
                nullability is not changed. Only non-nullable columns can be changed
                to nullable. Currently, you cannot change a nullable column to
                non-nullable.

            Each alteration must specify at least one of "rename", "data_type",
            or "nullable". The legacy key "name" is also accepted for renaming.
            Unknown keys raise ValueError before any alterations are applied.

        Returns
        -------
        AlterColumnsResult
            version: the new version number of the table after the alteration.
        Nre   ©rH  Úalterationss     rh   Úalter_columnszTable.alter_columnsR  r_  rj   c                 ó   — y)u›  
        Update per-field (column) metadata.

        Parameters
        ----------
        updates : dict
            One or more dicts, each with:

            - "path": str â€” dot-path to the field (e.g. "embedding" or "a.b.c").
            - "metadata": dict[str, str | None] â€” keys to set; a value of ``None``
              deletes that key.
            - "replace": bool, optional â€” replace the field's whole metadata map
              instead of merging (default False).

            The following keys are treated specially, by convention, and should
            be used when appropriate:

            - "lancedb:description": for a human-readable description of a field.
            - ``"lancedb:tag:<name>"`` for a user-defined key-value tag, where the
                suffix names the tag category; e.g. "lancedb:tag:model": "clip".
            - "lancedb:status" for status options ("production", "candidate",
                "deprecated", "archived") to designate the current life cycle
                state of this column.

        Returns
        -------
        UpdateFieldMetadataResult
            version: the new table version after the update.
        Nre   ©rH  Úupdatess     rh   Úupdate_field_metadatazTable.update_field_metadatat  r_  rj   ú0.33.1ú$Use update_field_metadata() instead.©Údeprecated_inÚcurrent_versionÚdetailsc                ó.   — | j                  ||ddœ«       y)a¨  Replace all metadata of a field in the schema.

        .. deprecated:: 0.33.1
            Use [update_field_metadata][lancedb.table.Table.update_field_metadata]
            with ``replace=True`` instead.

        Parameters
        ----------
        field_name: str
            The name of the field whose metadata is replaced.
        new_metadata: dict
            The new metadata, replacing all existing keys.
        T)Úpathr;  r§  N)rk  ©rH  rñ  Únew_metadatas      rh   Úreplace_field_metadatazTable.replace_field_metadata–  s   € ð& 	×"Ñ"Ø¨\ÀdÑKõ	
rj   c                 ó   — y)a-  
        Drop columns from the table.

        Parameters
        ----------
        columns : Iterable[str]
            The names of the columns to drop.

        Returns
        -------
        DropColumnsResult
            version: the new version number of the table dropping the columns.
        Nre   ©rH  r  s     rh   rü  zTable.drop_columns­  r_  rj   c                 ó   — y)áh  
        Checks out a specific version of the Table

        Any read operation on the table will now access the data at the checked out
        version. As a consequence, calling this method will disable any read consistency
        interval that was previously set.

        This is a read-only operation that turns the table into a sort of "view"
        or "detached head".  Other table instances will not be affected.  To make the
        change permanent you can use the `[Self::restore]` method.

        Any operation that modifies the table will fail while the table is in a checked
        out state. To return the table to a normal state use
        `[Self::checkout_latest]`.

        Parameters
        ----------
        version: int | str,
            The version to check out. A version number (`int`) or a tag
            (`str`) can be provided.
        Nre   ©rH  rO  s     rh   ÚcheckoutzTable.checkout½  r_  rj   c                 ó   — y©zð
        Ensures the table is pointing at the latest version

        This can be used to manually update a table when the read_consistency_interval
        is None
        It can also be used to undo a `[Self::checkout]` operation
        Nre   rG  s    rh   Úcheckout_latestzTable.checkout_latestÕ  r_  rj   c                 ó   — y)a  Restore a version of the table. This is an in-place operation.

        This creates a new version where the data is equivalent to the
        specified previous version. Data is not copied (as of python-v0.2.1).

        Parameters
        ----------
        version : int or str, default None
            The version number or version tag to restore.
            If unspecified then restores the currently checked out version.
            If the currently checked out version is the
            latest version then this is a no-op.
        Nre   r{  s     rh   ÚrestorezTable.restoreß  r_  rj   c                 ó   — y)úList all versions of the tableNre   rG  s    rh   Úlist_versionszTable.list_versionsï  r_  rj   c                óV   — t        | j                  j                  | j                  «      S r¨   )r5  Ú_connrì   rù   rG  s    rh   Ú_dataset_urizTable._dataset_urió  s   € ä˜$Ÿ*™*Ÿ.™.¨$¯)©)Ó4Ð4rj   c                ó  — ddl m} t        | |«      st        | j                  «      dk7  ryt        | j                  dd«      }t        |«      \  }}|j                  |«      j                  t        j                  j                  k7  }|||fS )Nr   )ÚRemoteTableÚfile)r’   NFÚ_indicesÚfts)Úremote.tabler‰  rn   rZ   r‡  r\   rY   Úget_file_inforû   Úpa_fsÚFileTypeÚNotFound)rH  r‰  rs  ÚfsÚindex_existss        rh   Ú_get_fts_index_pathzTable._get_fts_index_path÷  sy   € Ý-ä�d˜KÔ(¬N¸4×;LÑ;LÓ,MÐQWÒ,WØ$Ü˜×)Ñ)¨:°uÓ=ˆÜ˜tÓ$‰ˆˆDØ×'Ñ'¨Ó-×2Ñ2´e·n±n×6MÑ6MÑMˆØ�b˜,Ð'Ð'rj   c                óN   — | j                  «       \  }}}|rt        d|› d�«      ‚y )Nz%Legacy Tantivy FTS index detected at zo. Tantivy-based FTS has been removed. Delete the legacy index and recreate it with table.create_fts_index(...).)r”  ró   )rH  rs  r¶  Úexistss       rh   Ú_ensure_no_legacy_fts_indexz!Table._ensure_no_legacy_fts_index  s=   € Ø×2Ñ2Ó4‰ˆˆa�ÙÜØ7Ø�&ð /ð/óð ð rj   c                 ó   — y©úÉ
        Check if the table is using the new v2 manifest paths.

        Returns
        -------
        bool
            True if the table is using the new v2 manifest paths, False otherwise.
        Nre   rG  s    rh   Úuses_v2_manifest_pathszTable.uses_v2_manifest_paths  r_  rj   c                 ó   — y)ap  
        Migrate the manifest paths to the new format.

        This will update the manifest to use the new v2 format for paths.

        This function is idempotent, and can be run multiple times without
        changing the state of the object store.

        !!! danger

            This should not be run while other concurrent operations are happening.
            And it should also run until completion before resuming other operations.

        You can use
        [Table.uses_v2_manifest_paths][lancedb.table.Table.uses_v2_manifest_paths]
        to check if the table is already using the new path style.
        Nre   rG  s    rh   Úmigrate_v2_manifest_pathszTable.migrate_v2_manifest_paths  r_  rj   c                 ó   — y)zÀWhether a hybrid query here has already been refused ``_rowid``.

        Learned from a refusal, never probed, so asking is free. ``False`` for
        table types that never refuse.
        Fre   rG  s    rh   Ú_hybrid_pk_fusion_learnedzTable._hybrid_pk_fusion_learned+  s   € ð rj   c                 ó   — y)z?Remember a ``_rowid`` refusal, so later hybrid queries skip it.Nre   rG  s    rh   Ú_note_hybrid_pk_fusionzTable._note_hybrid_pk_fusion3  r_  rj   ©Úreturnro   ©r£  z	List[str]©r£  rÉ   ©r£  ú	pa.Schema©r£  ÚTags©r£  z
'Branches'©r£  úOptional[str]©r£  z"Dict[str, EmbeddingFunctionConfig]r¨   ©rc  r¬  r£  rÉ   ©rd  )rg  r%   r£  z'pandas.DataFrame'©rg  r%   r£  úpa.Table©r£  zlance.LanceDataset©r£  z'pl.LazyFrame')rv  ro   rw  úOptional[IndexConfigType]rx  rÌ   ry  rÌ   rz  ro   rx   r¬  r{  rÌ   r£  rÎ   )r�  ro   rŽ  ro   rx  rÌ   ry  rÌ   r…  rÉ   r€  rÉ   r�  rÉ   rˆ  rÉ   r‰  rÉ   r‚  rÌ   rx   r¬  r£  ÚIndexConfigType)r£  ro   r£  rô   ©r$  ro   rw  rµ  r§  rÎ   r¨  úOptional[timedelta]rù   r¬  r©  rÎ   r£  ÚNone©.............©$r�  z)Literal['l2', 'cosine', 'dot', 'hamming']rx  rÌ   ry  rÌ   rz  ro   r§  rÎ   rx   r¬  r{  rÌ   r…  rÉ   rŽ  zOLiteral['IVF_FLAT', 'IVF_SQ', 'IVF_PQ', 'IVF_RQ', 'IVF_HNSW_SQ', 'IVF_HNSW_PQ']r€  rÉ   r�  rÉ   rˆ  rÉ   r‰  rÉ   r¨  r·  rù   r¬  r©  rÎ   r‚  rÌ   r£  r¸  ©$r�  ro   rx  rÌ   ry  rÌ   rz  ro   r§  rÎ   rx   r¬  r{  rÌ   r…  rÉ   rŽ  z`Literal['IVF_FLAT', 'IVF_SQ', 'IVF_PQ', 'IVF_RQ', 'IVF_HNSW_SQ', 'IVF_HNSW_PQ', 'IVF_HNSW_FLAT']r€  rÉ   r�  rÉ   rˆ  rÉ   r‰  rÉ   rw  r´  r¨  r·  rù   r¬  r©  rÎ   r‚  rÌ   ©r$  ro   rw  rµ  r§  úOptional[bool]r¨  r·  rù   r¬  r©  rÎ   r£  r*   ©rù   ro   r£  r¸  ©rÄ  úIterable[str]rÅ  r   r£  r¸  ©r£  ÚTableStatistics©
r$  ro   r§  rÎ   rŽ  rÅ   r¨  r·  rù   r¬  ©,rÙ  zUnion[str, List[str]]rÑ  úOptional[Union[str, List[str]]]r§  rÎ   rÒ  rÌ   rÓ  rÎ   r£  r¬  rÔ  rÎ   r    rÆ   r¥   ro   r•  rÌ   r–  rÎ   r—  r½  r˜  r½  rÕ  úOptional[List[str]]r™  rÎ   rš  rÉ   r›  rÉ   rœ  rÎ   rÖ  rÉ   r×  rO   r¨  r·  rù   r¬  ©r3  Úerrorç        NNF©rë   r2   rÜ  rÃ   r[  rÂ   r\  rÐ   rA  ú$Optional[Union[bool, Callable, Any]]rÝ  rÌ   rÞ  rÎ   r£  r·   ©rä  úUnion[str, Iterable[str]]r£  rF   ©NNÚautoNNN©r4  úBOptional[Union[VEC, str, 'PIL.Image.Image', Tuple, FullTextQuery]]rz  r¬  ré  rÁ   rê  r¬  rë  rÅ  rì  r½  r£  rT   ©r­  ú	list[int]rï  rÎ   r£  rV   )r­  rÓ  r£  úpa.RecordBatch©r  rÓ  rï  rÎ   r£  rV   ©r£  z	list[str]©r$  ro   r  ú5Union[list[int], pa.Array, pa.ChunkedArray, pa.Table]r£  úpa.LargeBinaryArray©r$  ro   r  zSequence[Sequence[int]]r£  rÙ  ©r$  ro   r  rØ  r£  z'list[Optional[BlobFile]]'©r  z"Union[dict, pa.StructScalar, None]r£  zOptional[BlobFile])r  r   r£  zIterator[Optional[BlobFile]]©r4  rW   rÓ   rÌ   rÅ  r·  r£  úpa.RecordBatchReader©F©r4  rW   r   r½  r£  ro   ©r4  rW   r$  rI   r£  ro   ©r4  rW   r£  r§  ©
r-  rF   r.  r2   r[  rÂ   r\  rÐ   r£  r¾   ©r1  zUnion[str, Expr]r£  rº   ©NN©r1  úOptional[Union[str, Expr]]r«   úOptional[dict]r4  úOptional[Dict[str, str]]r£  r¿   ©r<  r·  r9  rÎ   r£  z'CleanupStats'©rŒ   r·  r9  rÎ   r�   rÎ   rA  úOptional[CompactionOptions]©r£  zIterable[IndexConfig]©r4  ro   r$  r¬  rI  r¬  r£  zIterable[FtsToken]©rI  ro   r£  zOptional[IndexStatistics])rX  úiDict[str, str | FunctionApplication] | FunctionApplication | pa.Field | List[pa.Field] | pa.Schema | NonerS  úDict[str, str] | NonerT  úbool | NonerU  ú
int | None©r$  ro   r£  z'RefreshColumnResult'©r$  ro   r£  zJob[RefreshColumnJobResult]©NNN©ra  r¬  r$  r¬  rb  rÌ   r£  z'FunctionErrors')rf  úIterable[Dict[str, str]]©rj  zdict[str, Any]r£  r¹   ©rñ  ro   ru  zDict[str, str]©r  rÀ  r£  r»   ©rO  zUnion[int, str]©rO  zOptional[Union[int, str]]©r£  zList[Dict[str, Any]])r£  z"Tuple[str, pa_fs.FileSystem, bool]©r£  rÎ   ©r£  r¸  )Urà   rá   râ   rã   Úpropertyr   rù   rJ  rM  rO  r  rS  rV  rY  r\  r^  r[  rf  rA  rn  rp  r|  r�  Ústaticmethodr¥  r   r¬  r4   r»  r¾  r   rÆ  rÉ  rÍ  rO   ÚROWrÚ  rß  rå  rí  rñ  r  r  r  r  r  r  r  r  r  r!  r'  r*  r/  r2  r7  r=  r?  rE  rG  rM  rQ  rY  r\  r^  rc  rg  rk  ÚdeprecationÚ
deprecatedr   rv  rü  r|  r  r�  r„  r	   r‡  r”  r—  r›  r�  rŸ  r¡  re   rj   rh   r°   r°   }  se  „ ñ#ðJ ØòOó ó ðOð òó ðð ò6ó ð6ð ØòRó ó ðRð ØòQó ó ðQð ØòOó ó ðOð6 òSó ðSóYó%ð Øòó ó ðð
 ó	Uó ð	Uô3ð" Ø06ô Só ðSó"
SôTð0àðð *ðð &ð	ð
 'ðð  ðð #ðð (ðð 
óðBYAàðYAð ðYAð &ð	YAð
 'ðYAð ðYAð ðYAð ðYAð ðYAð ðYAð  -ðYAð #ðYAð 
óYAðv ò<
ó ð<
ð~ ð Ø,/Ø!Øñ
àð
ð
  ð
ð ð
ð *ð
ð ð
ð ð
ð 
ò
ó ð
ð ð =@Ø(+Ø),Ø"%ØØ%(Ø*-Øð Ø!ØØØ"ð!ð$ -0Ø!ØØ/2ñ+à9ðð &ðð 'ð	ð
  ðð ðð #ðð (ðð ðð
ðð ðð ðð ðð  ð!ð$ *ð%ð& ð'ð( ð)ð*  -ð+ð, 
ò-ó ðð4 Ø(,Ø)-Ø"4ØØ%)Ø*.Øð Ø ØØØ"ð-IWð0 -1Ø,0Ø"ØØ/3ñ9IWàðIWð &ðIWð 'ð	IWð
  ðIWð ðIWð #ðIWð (ðIWð ðIWð
ðIWð& ð'IWð( ð)IWð* ð+IWð, ð-IWð0 *ð1IWð2 *ð3IWð4 ð5IWð6 ð7IWð8  -ó9IWð` #'Ø,0Ø"Øñ
àð
ð  ð	
ð
  ð
ð *ð
ð ð
ð ð
ð 
ó
ó(Uñ* @IÐQTÔ?UðYØ(ðYØ3<ðYà	óYð" òPó ðPð ð
 Ø&-Ø,0Ø"ñ@
àð@
ð ð	@
ð
 $ð@
ð *ð@
ð ò@
ó ð@
ðL AEØØ*<Ø!Ø(,Ø#à,4Ø!Ø*,ØØ#Ø,0Ø15Ø"Ø !Ø !Ø!ØØ4G×4KÑ4KØ,0Ø"ñ3~
à*ð~
ð >ð	~
ð
 ð~
ð (ð~
ð ð~
ð &ð~
ð ð~
ð *ð~
ð ð~
ð (ð~
ð ð~
ð ð~
ð  *ð!~
ð" /ð#~
ð$ ð%~
ð& ð'~
ð( ð)~
ð* ð+~
ð, ð-~
ð. 2ð/~
ð0 *ð1~
ð2 ó3~
ð@ ð !Ø+2ØØ9=Ø+/Ø27ðGNàðGNð ðGNð )ð	GNð
 ðGNð 7ðGNð )ðGNð ,0ðGNð 
òGNó ðGNóR>1ð@ ð
 Ø,0Ø &Ø-1Ø7;Ø&*ðVQð
ðVQð
 *ðVQð ðVQð +ðVQð 5ðVQð $ðVQð 
òVQó ðVQðp à9>ñØ ðØ26ðà	òó ðó>0ðd à9>ñ"Ø ð"Ø26ð"à	ò"ó ð"ðH òó ðð ðàðð Gðð 
ò	ó ðð2 ðàðð *ðð 
ò	ó ðð0 ðàðð Gðð 
$ò	ó ðð( ðØ<ðà	òó ðó(2ð" ð
 %)Ø'+ñ#àð#ð "ð	#ð
 %ð#ð 
ò#ó ð#ð ÛVó ØVàð
 >Iñ	àðð ;ð	ð
 
òó ðð Ú<ó Ø<àðà&ðð ðð )ð	ð
 ðð 
òó ðð ò7Qó ð7Qðr ð -1Ø!%ð@Qð
 04ñ@Qà)ð@Qð ð@Qð
 -ð@Qð 
ò@Qó ð@QðD ð +/ð#ð #(ñ	#à'ð#ð  ð	#ð
 
ò#ó ð#ðJ ñó ðð* ð 37Ø"'ØØ:>ñ;ð 0ð;ð  ð	;ð
 ð;ð 8ò;ó ð;ðz òó ðð ð
 !%Ø$(ñàðð ð	ð
 "ðð 
òó ðð* òó ðð ð ðWð +/Ø,0Ø48ñWððWð (ðWð *ðWð (2òWó ðWðr òó ðð6 ò!ó ð!ðF ð !%Ø $Ø#ð	&àð&ð ð&ð ð	&ð
 
ò&ó ð&ðP òó ððB ðØ&ðà	"òó ððB €[×ÑØØ#Ø6ôò

óð

ð$ òó ðð òó ðð. ñó ðð óó ðð ò-ó ð-ð ò5ó ð5ó(òð òó ðð ñó ðó(ôNrj   r°   c                  óš	  — e Zd ZdZddddddddddœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆd„Zed‰d„«       ZedŠd„«       Zed‹d„«       Z	edddddddd	œ	 	 	 	 	 	 	 	 	 	 	 	 	 dŒd
„«       Z
ed‰d„«       Zd�d„ZedŽd„«       Zd�d„Zed�d„«       Zddœ	 	 	 	 	 d‘d„Zddœ	 	 	 	 	 d’d„Zd“d„Z	 	 	 	 	 	 d”d„Z	 	 	 	 	 	 d•d„Z	 	 	 	 	 	 d–d„Z	 	 	 	 d—d„Zed˜d„«       Zed™d„«       Zdšd„Z	 d›	 	 	 	 	 dœd„Zd�d„Zd„ Zd›džd„Zd›dŸd„Zd‰d „Z d‰d!„Z!d d¡d"„Z"d¢d£d$„Z#d#d%œd¤d&„Z$d›d¥d'„Z%e&d(d(d(d(d)œ	 	 	 	 	 	 	 	 	 	 	 	 	 d¦d*„«       Z'e&	 	 	 	 	 	 	 	 	 	 	 	 	 d§d(d(d(d(d+œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d¨d,„«       Z'd-dde(d.ddd/d0d1d2d3d4fdddd.dd5œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d©d6„Z'dddd.d)œ	 	 	 	 	 	 	 	 	 	 	 	 	 dªd7„Z)d«d8„Z*d«d9„Z+d›d¬d:„Z, e-d4¬;«      f	 	 	 	 	 d­d<„Z.d®d=„Z/ed‰d>„«       Z0d¯d?„Z1d¯d@„Z2 e3jh                  dAe5dB¬C«      d.dDdddEœ	 	 	 	 	 	 	 	 	 d°dF„«       Z6 e3jh                  dAe5dG¬C«      dddHddddIdJdKd.dddd.dLdLddMe7jp                  dddNœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d±dO„«       Z9	 	 	 	 	 	 d²	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d³dP„Z:	 	 d´	 	 	 	 	 	 	 dµdQ„Z;ed¶dR„«       Z<e&	 	 	 	 	 	 d·	 	 	 	 	 	 	 	 	 	 	 	 	 d¸dS„«       Z=e&	 	 	 	 	 	 d¹	 	 	 	 	 	 	 	 	 	 	 	 	 dºdT„«       Z=e&	 	 	 	 	 	 d»	 	 	 	 	 	 	 	 	 	 	 	 	 d¼dU„«       Z=e&	 	 	 	 	 	 d½	 	 	 	 	 	 	 	 	 	 	 	 	 d¾dV„«       Z=	 	 	 	 	 	 d½	 	 	 	 	 	 	 	 	 	 	 	 	 d¿dW„Z=e	 	 	 	 	 	 	 dÀdddddddddXœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dÁdY„«       Z>dÂdZ„Z?	 	 d´dd[œ	 	 	 	 	 	 	 dÃd\„Z@ddd]œ	 	 	 	 	 	 	 dÄd^„ZAdÅdÆd_„ZBd`daœ	 	 	 	 	 dÇdb„ZCdÈdc„ZD	 	 	 	 	 	 	 	 	 	 dÉdd„ZEedÊde„«       ZF e3jh                  dfe5dg¬C«      	 d›ddhœ	 	 	 	 	 dËdi„«       ZG e3jh                  dfe5dg¬C«      dÌdj„«       ZHdddddkœ	 	 	 	 	 	 	 dÍdl„ZIdÎdm„ZJdddnœ	 	 	 	 	 	 	 dÏdo„ZKdÐdp„ZL	 d›ddddqœ	 	 	 	 	 	 	 	 	 dÑdr„ZMdÒds„ZNdÓdt„ZO	 	 	 dÔ	 	 	 	 	 	 	 dÕdu„ZP	 	 	 	 dÖdv„ZQ	 	 	 	 d×dw„ZRdØdx„ZSdÙdy„ZTdÚdz„ZUdÛd{„ZVdÜd|„ZWdÛd}„ZXdÛd~„ZYdÛd„ZZdd€œdÝd�„Z[dÛd‚„Z\dÞdƒ„Z]d„„ Z^ e3jh                  d…e5d†¬C«      dßd‡„«       Z_y)àÚ
LanceTablea  
    A table in a LanceDB database.

    This can be opened in two modes: standard and time-travel.

    Standard mode is the default. In this mode, the table is mutable and tracks
    the latest version of the table. The level of read consistency is controlled
    by the `read_consistency_interval` parameter on the connection.

    Time-travel mode is activated by specifying a version number. In this mode,
    the table is immutable and fixed to a specific version. This is useful for
    querying historical versions of the table.
    NF)	Únamespace_pathÚstorage_optionsr{  Úlocationrf   Úmanaged_versioningrg   Úroute_pushdown_to_rustÚ_asyncc       	        ó6  — |€g }|| _         || _        || _        || _        |	xs
 t	        «       | _        |
| _        |�|| _        n:t        j                  |j                   j                  |||||||¬«      «      | _        | j
                  | j                  _        y )N)r  r	  r{  r
  rf   r  )r†  Ú_namespace_pathÚ	_locationÚ_namespace_clientr  Ú_pushdown_operationsÚ_route_pushdown_to_rustÚ_tabler'   ÚrunÚ
open_table)rH  Ú
connectionrù   r  r	  r{  r
  rf   r  rg   r  r  s               rh   Ú__init__zLanceTable.__init__F  s¥   € ð Ð!ØˆNØˆŒ
Ø-ˆÔØ!ˆŒØ!1ˆÔØ$7Ò$@¼3»5ˆÔ!ð (>ˆÔ$ØÐØ ˆD�KäŸ(™(Ø× Ñ ×+Ñ+ØØ#1Ø$3Ø%5Ø%Ø%5Ø'9ð ,ó ó
ˆDŒKð ,0×+DÑ+Dˆ�‰Õ(rj   c                ó.   — | j                   j                  S r¨   )r  rù   rG  s    rh   rù   zLanceTable.nameu  s   € à�{‰{×ÑÐrj   c                ó   — | j                   S )z'Return the namespace path of the table.)r  rG  s    rh   rJ  zLanceTable.namespacey  s   € ð ×#Ñ#Ð#rj   c              ƒ  óà   K  — ddl m}m} t        |«      }|j	                  «       } ||«      j                  «       ƒ d {  –—† } |j                  ||«      } | ||j                  |¬«      S 7 Œ,­w)Nr   )ÚAsyncConnectionr¯   )r  )Údbr  r¯   Ú
AsyncTableÚdatabaseÚget_read_consistency_intervalÚ
from_innerrù   )Úclsr  r  r¯   Ú	async_tblÚ
inner_connÚread_consistency_intervalÚconns           rh   r!  zLanceTable.from_inner~  sp   è ø€ ç:ä˜s“Oˆ	Ø—\‘\“^ˆ
Ù*9Øó+
ç
'Ñ
'Ó
)÷%*Ð!ð ,Ð ×+Ñ+¨JÐ8QÓRˆÙØØ�N‰NØô
ð 	
ð	%*ús   ‚=A.¿A,Á -A.©r  r	  r{  r
  rf   r  rg   c               ó¨   — |€g } | |||||||||	¬«	      }
	 |
j                    |
S # t        $ r#}dt        |«      v rt        d|› d�«      ‚|‚d }~ww xY w)Nr'  z
Not found:zTable z does not exist)rO  ró   ro   ÚFileNotFoundError)r"  r  rù   r  r	  r{  r
  rf   r  rg   r  Úes               rh   ÚopenzLanceTable.openŽ  s~   € ð Ð!ØˆNÙØØØ)Ø+Ø-ØØ-Ø1Ø 3ô

ˆð	Ø�KŠKð ˆ
øô ò 	Øœs 1›vÑ%Ü'¨&°°°oÐ(FÓGÐGØˆGûð	ús   —% ¥	A®AÁAc                ó†   — | j                   �| j                   S t        | j                  j                  | j                  «      S r¨   )r  r;  r†  rì   rù   rG  s    rh   Ú_dataset_pathzLanceTable._dataset_path´  s1   € ð
 �>‰>Ð%Ø—>‘>Ð!Ü˜4Ÿ:™:Ÿ>™>¨4¯9©9Ó5Ð5rj   c                óv  — 	 ddl }| j                  «       }|�dn| j                  }| j                  }|€Rt        | j                  dd«      }t        |«      dk(  s| j                  r!| j                  j                  «       }|| _        |�F| j                  | j                  gz   } |j                  d	|| j                  j                  ||dœ|¤Ž}n4 |j                  | j                  f|| j                  j                  dœ|¤Ž}|�|j                  || j                  f«      }|S # t        $ r t        d«      ‚w xY w)
z+Return the LanceDataset backing this table.r   Nú^The lance library is required to use this function. Please install with `pip install pylance`.rì   r’   rJ  )rO  r	  rf   Útable_id©rO  r	  re   )r/   rs   rY  rO  r  r“   r†  rZ   r  rf   rù   r?  r	  r-  Úcheckout_version)	rH  rh  r/   ÚbranchrO  rf   Úconn_urir0  Údss	            rh   rn  zLanceTable.to_lance½  sS  € ð	Ûð ×$Ñ$Ó&ˆØ Ð,‘$°$·,±,ˆØ×1Ñ1ÐØÐ#Ü˜tŸz™z¨5°"Ó5ˆHÜ˜hÓ'¨;Ò6¸$×:NÒ:NØ#'§:¡:×#>Ñ#>Ó#@Ð Ø)9�Ô&àÐ'Ø×+Ñ+¨t¯y©y¨kÑ9ˆHØ�—‘ð ØØ $§
¡
× :Ñ :Ø!1Ø!ñ	ð
 ñ‰Bð �—‘Ø×"Ñ"ðàØ $§
¡
× :Ñ :ñð ñ	ˆBð ÐØ×$Ñ$ f¨d¯l©lÐ%;Ó<ˆBØˆ	øôC ò 	Üð=óð ð	ús   ‚D# Ä#D8c                ó\   — t        j                  | j                  j                  «       «      S )zwReturn the schema of the table.

        Returns
        -------
        pa.Schema
            A PyArrow schema object.)r'   r  r  r  rG  s    rh   r  zLanceTable.schemaä  s    € ô �x‰x˜Ÿ™×*Ñ*Ó,Ó-Ð-rj   c                ó\   — t        j                  | j                  j                  «       «      S )rƒ  )r'   r  r  r„  rG  s    rh   r„  zLanceTable.list_versionsî  s   € ä�x‰x˜Ÿ™×1Ñ1Ó3Ó4Ð4rj   c                ó\   — t        j                  | j                  j                  «       «      S )z$Get the current version of the table)r'   r  r  rO  rG  s    rh   rO  zLanceTable.versionò  s    € ô �x‰x˜Ÿ™×+Ñ+Ó-Ó.Ð.rj   rî  c               ór   — t        | j                  j                  |«      «      }|r|j                  «        |S r¨   )rV   r  rñ  rï  )rH  r­  rï  Úbuilders       rh   rñ  zLanceTable.take_offsets÷  ó1   € ô (¨¯©×(@Ñ(@ÀÓ(IÓJˆÙØ×ÑÔ!Øˆrj   c               ór   — t        | j                  j                  |«      «      }|r|j                  «        |S r¨   )rV   r  r  rï  )rH  r  rï  r:  s       rh   r  zLanceTable.take_row_idsÿ  r;  rj   c                ó\   — t        j                  | j                  j                  «       «      S r¨   )r'   r  r  r  rG  s    rh   r  zLanceTable.blob_columns  s   € Ü�x‰x˜Ÿ™×0Ñ0Ó2Ó3Ð3rj   c                ó`   — t        j                  | j                  j                  ||«      «      S r¨   )r'   r  r  r  r
  s      rh   r  zLanceTable.fetch_blobs
  s$   € ô
 �x‰x˜Ÿ™×/Ñ/°¸Ó@ÓAÐArj   c                ór   — t        j                  | j                  j                  |t	        |«      «      «      S r¨   )r'   r  r  r  r
  r  s      rh   r  zLanceTable.fetch_blob_ranges  s(   € ô
 �x‰x˜Ÿ™×5Ñ5°f¼dÀ8»nÓMÓNÐNrj   c                ó`   — t        j                  | j                  j                  ||«      «      S r¨   )r'   r  r  r  r
  s      rh   r  zLanceTable.fetch_blob_files  s$   € ô
 �x‰x˜Ÿ™×4Ñ4°V¸WÓEÓFÐFrj   c                ó^   — t        j                  | j                  j                  |«      «      S r¨   )r'   r  r  r  r  s     rh   r  zLanceTable.open_blob_file  s"   € ô �x‰x˜Ÿ™×2Ñ2°:Ó>Ó?Ð?rj   c                ó,   — t        | j                  «      S )a0  Tag management for the table.

        Similar to Git, tags are a way to add metadata to a specific version of the
        table.

        .. warning::

            Tagged versions are exempted from the :py:meth:`cleanup_old_versions()`
            process.

            To remove a version that has been tagged, you must first
            :py:meth:`~Tags.delete` the associated tag.

        Returns
        -------
        Tags
            The tag manager for managing tags for the table.

        Examples
        --------
        >>> import lancedb
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table",
        ...    [{"vector": [1.1, 0.9], "type": "vector"}])
        >>> table.tags.create("v1", table.version)
        >>> table.add([{"vector": [0.5, 0.2], "type": "vector"}])
        AddResult(version=2)
        >>> tags = table.tags.list()
        >>> print(tags["v1"]["version"])
        1
        >>> table.checkout("v1")
        >>> table.to_pandas()
               vector    type
        0  [1.1, 0.9]  vector
        )r©  r  rG  s    rh   rS  zLanceTable.tags$  s   € ôJ �D—K‘KÓ Ð rj   c                ó   — t        | «      S )z§Branch management for the table.

        ``create``/``checkout`` return a new table handle scoped to the branch;
        writes on it do not affect ``main``.
        )ÚBranchesrG  s    rh   rV  zLanceTable.branchesK  s   € ô ˜‹~Ðrj   c                ó6   — | j                   j                  «       S ©rX  )r  rY  rG  s    rh   rY  zLanceTable.current_branchT  ó   € à�{‰{×)Ñ)Ó+Ð+rj   c           
     ó´   — t        | j                  |j                  | j                  | j                  | j
                  | j                  | j                  |¬«      S )N)r  rf   rg   r  r
  r  )r  r†  rù   r  r  r  r  r  ©rH  Úasync_tablerO  s      rh   Ú_wrap_branch_handlezLanceTable._wrap_branch_handleX  sO   € ô
 Ø�J‰JØ×ÑØ×/Ñ/Ø!×3Ñ3Ø $× 9Ñ 9Ø#'×#?Ñ#?Ø—^‘^Øô	
ð 		
rj   c                ó`   — t        j                  | j                  j                  |«      «       y)a�  Checkout a version of the table. This is an in-place operation.

        This allows viewing previous versions of the table. If you wish to
        keep writing to the dataset starting from an old version, then use
        the `restore` function.

        Calling this method will set the table into time-travel mode. If you
        wish to return to standard mode, call `checkout_latest`.

        Parameters
        ----------
        version: int | str,
            The version to check out. A version number (`int`) or a tag
            (`str`) can be provided.

        Examples
        --------
        >>> import lancedb
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table",
        ...    [{"vector": [1.1, 0.9], "type": "vector"}])
        >>> table.version
        1
        >>> table.to_pandas()
               vector    type
        0  [1.1, 0.9]  vector
        >>> table.add([{"vector": [0.5, 0.2], "type": "vector"}])
        AddResult(version=2)
        >>> table.version
        2
        >>> table.checkout(1)
        >>> table.to_pandas()
               vector    type
        0  [1.1, 0.9]  vector
        N)r'   r  r  r|  r{  s     rh   r|  zLanceTable.checkouth  s    € ôH 	�‰�—‘×%Ñ% gÓ.Õ/rj   c                ó^   — t        j                  | j                  j                  «       «       y)zÁCheckout the latest version of the table. This is an in-place operation.

        The table will be set back into standard mode, and will track the latest
        version of the table.
        N)r'   r  r  r  rG  s    rh   r  zLanceTable.checkout_latestŽ  s   € ô 	�‰�—‘×,Ñ,Ó.Õ/rj   c                ó¾   — |�.t        j                  | j                  j                  |«      «       t        j                  | j                  j	                  «       «       y)a‘  Restore a version of the table. This is an in-place operation.

        This creates a new version where the data is equivalent to the
        specified previous version. Data is not copied (as of python-v0.2.1).

        Parameters
        ----------
        version : int or str, default None
            The version number or version tag to restore.
            If unspecified then restores the currently checked out version.
            If the currently checked out version is the
            latest version then this is a no-op.

        Examples
        --------
        >>> import lancedb
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table", [
        ...     {"vector": [1.1, 0.9], "type": "vector"}])
        >>> table.version
        1
        >>> table.to_pandas()
               vector    type
        0  [1.1, 0.9]  vector
        >>> table.add([{"vector": [0.5, 0.2], "type": "vector"}])
        AddResult(version=2)
        >>> table.version
        2
        >>> table.tags.create("v2", 2)
        >>> table.restore(1)
        >>> table.to_pandas()
               vector    type
        0  [1.1, 0.9]  vector
        >>> len(table.list_versions())
        3
        >>> table.restore("v2")
        >>> table.to_pandas()
               vector    type
        0  [1.1, 0.9]  vector
        1  [0.5, 0.2]  vector
        >>> len(table.list_versions())
        4
        N)r'   r  r  r|  r�  r{  s     rh   r�  zLanceTable.restore–  s?   € ðX ÐÜ�H‰H�T—[‘[×)Ñ)¨'Ó2Ô3Ü�‰�—‘×$Ñ$Ó&Õ'rj   c                ó^   — t        j                  | j                  j                  |«      «      S r¨   )r'   r  r  r[  rb  s     rh   r[  zLanceTable.count_rowsÆ  s    € Ü�x‰x˜Ÿ™×.Ñ.¨vÓ6Ó7Ð7rj   c                óh   — | j                   j                  › d| j                  ›d| j                  ›d�S )Nz(name=z, _conn=ú))r7  rà   rù   r†  rG  s    rh   Ú__repr__zLanceTable.__repr__É  s/   € Ø—.‘.×)Ñ)Ð*¨&°·±°¸XÀdÇjÁjÀ^ÐSTÐUÐUrj   c                ó"   — | j                  «       S r¨   )rR  rG  s    rh   Ú__str__zLanceTable.__str__Ì  s   € Ø�}‰}‹Ðrj   c                ó^   — t        j                  | j                  j                  |«      «      S )z%Return the first n rows of the table.)r'   r  r  Úhead©rH  Úns     rh   rV  zLanceTable.headÏ  s    € ä�x‰x˜Ÿ™×(Ñ(¨Ó+Ó,Ð,rj   rd  c                ó&  — t        |«       |dk(  st        | j                  «      sF| j                  «       }|dk(  rt	        |t        | j                  «      «      } |j                  di |¤ŽS |dk(  rD| j                  €8t        | j                  «      dk(  r  | j                  «       j                  di |¤ŽS |dk(  r7t        | j                  «      r" | j                  «       j                  dd|i|¤ŽS  | j                  «       j                  dd|i|¤ŽS )a1  Return the table as a pandas DataFrame.

        Parameters
        ----------
        blob_mode: str, default "lazy"
            Controls how Lance blob columns are returned.
        **kwargs
            Forwarded to Lance pandas conversion.

        Returns
        -------
        pd.DataFrame
        Údescriptionsrd  Úmemoryrð   rg  re   )r$   rb   r  rA  r#   ra   rf  r  rZ   r-  r_   rí  rn  )rH  rg  rh  Ú	arrow_tbls       rh   rf  zLanceTable.to_pandasÓ  sÿ   € ô 	˜9Ô%Ø˜Ò&Ô.CÀDÇKÁKÔ.PØŸ™›ˆIØ˜NÒ*Ü.ØÔ<¸T¿[¹[ÓIó�	ð '�9×&Ñ&Ñ0¨Ñ0Ð0ð ˜ÒØ×&Ñ&Ð.Ü˜t×1Ñ1Ó2°hÒ>à,�4—=‘=“?×,Ñ,Ñ6¨vÑ6Ð6à˜ÒÔ$8¸¿¹Ô$EØ*�4—;‘;“=×*Ñ*ÑI°YÐIÀ&ÑIÐIà(ˆt�}‰}‹×(Ñ(ÑG°9ÐGÀÑGÐGrj   ri  c               óŒ  — t        |«       |dk7  r5t        | j                  «      r | j                  «       j	                  |¬«      S t        | j                  | j                  «      r3| j                  s'| j                  t        «       «      j                  «       S t        j                  | j                  j	                  «       «      S )a±  Return the table as a pyarrow Table.

        Parameters
        ----------
        blob_mode: str, default "lazy"
            ``"lazy"`` returns blob v2 descriptors that carry the row id
            ``fetch_blobs`` reads. ``"descriptions"`` returns them without it.
            ``"bytes"`` returns payload bytes and raises for legacy blob columns
            and blobs inside lists.

        Returns
        -------
        pa.Tablerd  ri  )r$   rb   r  rí  rA  ri   r  r  r  r  rW   rL  r'   r  r  rl  s     rh   rA  zLanceTable.to_arrowö  s–   € ô 	˜9Ô%Ø˜ÒÔ#8¸¿¹Ô#EØ—;‘;“=×)Ñ)°IÐ)Ó>Ð>ä)Ø×&Ñ&¨×(AÑ(Aôð ×0Ò0à×&Ñ&¤u£wÓ/×8Ñ8Ó:Ð:ä�x‰x˜Ÿ™×,Ñ,Ó.Ó/Ð/rj   c                óv   — ddl m}  || «      }t        j                  ||¬«      j	                  t
        d¬«      S )a  Return the table as a polars LazyFrame.

        Parameters
        ----------
        batch_size: int, optional
            Passed to polars. This is the maximum row count for
            scanned pyarrow record batches

        Note
        ----
        1. This requires polars to be installed separately
        2. Currently we've disabled push-down of the filters from polars
           because polars pushdown into pyarrow uses pyarrow compute
           expressions rather than SQl strings (which LanceDB supports)
        3. The Polars streaming engine is not supported because it does not
           currently implement Python PyArrow dataset scans. Use the default
           engine when collecting this LazyFrame.

        Returns
        -------
        pl.LazyFrame
        r   )ÚPyarrowDatasetAdapter)rÓ   F)Úpredicate_pushdown)Úlancedb.integrations.pyarrowr_  ÚplÚscan_pyarrow_datasetÚmap_batchesr~   )rH  rÓ   r_  r?  s       rh   rp  zLanceTable.to_polars  s@   € õ. 	Gá'¨Ó-ˆô ×&Ñ& w¸:ÔF×RÑRÜ.Ø$ð Só 
ð 	
rj   .r¦  c               ó   — y r¨   re   r«  s          rh   r¬  zLanceTable.create_index4  r­  rj   r®  c                ó   — y r¨   re   r°  s                     rh   r¬  zLanceTable.create_indexB  r±  rj   ræ   Tr²  r„  r³  r´  rµ  r¶  r·  c               óˆ  — | j                  |||||||«      }|r†t        j                  dt        d¬«       |}| j	                  ||	||||
|||||¬«      }|��9| j                  «       }t        |«       |j                  ||	||||||||||¬«       | j                  «        y|}|�ìt        |d«      ràt        |dd«      }|�Ñ| j                  «       }t        |«       dd	d
ddddœ}t        |«      j                  }|j                  |d
«      }i }t        |dd«      }|�||d<    |j                  d||t        |dd«      t        |dd«      t        |dd«      ||t        |dd«      t        |dd«      t        |dd«      dœ
|¤Ž | j                  «        yt        j                  | j                   j                  ||||||¬«      «      S )r¹  aF  The create_index() API with metric/num_partitions parameters is deprecated and will be removed in a future version. Please migrate to the new unified API:
  # Old (deprecated):
  table.create_index('l2', vector_column_name='my_vector')
  # New (recommended):
  table.create_index('my_vector', config=IvfPq(distance_type='l2'))r   r„   )r�  rŽ  rx  ry  r…  r€  r�  rˆ  r‰  r‚  rx   N)r$  rŽ  r�  rx  ry  r§  rx   r{  r…  rˆ  r‰  r‚  rx   r~  rƒ  r„  r†  r‡  rŠ  )r8   r:   r9   r<   r?   r@   r…  r²  r  ræ   rx  ry  rˆ  rµ  r‰  r¶  r‚  )
r$  rŽ  r�  rx  ry  r§  rx   rˆ  r‰  r‚  ©r§  rw  r¨  rù   r©  re   )r|  rˆ   r‰   r‹   r�  rn  r{   r¬  r  r  r“   rû   rà   r  r'   r  r  )rH  r�  rx  ry  rz  r§  rx   r{  r…  rŽ  r€  r�  rˆ  r‰  rw  r¨  rù   r©  r‚  Ú	is_legacyr$  r?  ÚaccÚindex_type_mapÚcfg_typeÚlance_index_typeÚquantization_kwargss                              rh   r¬  zLanceTable.create_index[  sQ  € ðT ×5Ñ5ØØØØØØØó
ˆ	ñ Ü�M‰MðVô #Øõ
ð (ˆFð ×AÑAØØ%Ø-Ø /Ø!Ø-Ø'ØØ /Ø&;Ø'ð Bó ˆFð Ñ&ØŸ-™-›/�Ü+¨KÔ8Ø×$Ñ$Ø!Ø)Ø!Ø#1Ø$3Ø#Ø +Ø%5Ø%ØØ$3Ø*?ð %ô ð ×$Ñ$Ô&Øð ˆFð Ð!¤g¨f°mÔ&DÜ˜f m°TÓ:�Ø�?à"Ÿm™m›o�GÜ/°Ô4à#-Ø!)Ø!)Ø!)Ø"/Ø"/ñ&�Nô  $ F›|×4Ñ4�HØ'5×'9Ñ'9¸(ÀHÓ'MÐ$à*,Ð'Ü& v¨z¸1Ó=�HØÐ+Ø:BÐ+¨JÑ7à(�G×(Ñ(ð Ø%Ø#3Ü& v¨ÀÓEÜ'.¨vÐ7GÈÓ'NÜ(/°Ð8IÈ4Ó(PØ 'Ø$'Ü! &¨#¨rÓ2Ü(/°Ð8IÈ3Ó(OÜ.5Ø"Ð$;¸Tó/ñð .òð ×(Ñ(Ô*Øä�x‰xØ�K‰K×$Ñ$ØØØØ)ØØð %ó ó	
ð 		
rj   c               ó|   — t        t        j                  | j                  j	                  ||||||¬«      «      «      S )zÊCreate an index, returning a handle to the indexing job.

        The job may already be complete when returned; callers must not assume
        the index exists until :meth:`Job.wait` returns.
        rh  )r*   r'   r  r  r»  r«  s          rh   r»  zLanceTable.create_index_async  sF   € ô Ü�H‰HØ—‘×.Ñ.ØØ#Ø!Ø!-ØØð /ó ó	ó
ð 	
rj   c                ó^   — t        j                  | j                  j                  |«      «      S )z’
        Drops an index from the table

        Parameters
        ----------
        name: str
            The name of the index to drop
        )r'   r  r  r¾  r½  s     rh   r¾  zLanceTable.drop_index6  s"   € ô �x‰x˜Ÿ™×.Ñ.¨tÓ4Ó5Ð5rj   c                ó^   — t        j                  | j                  j                  |«      «      S )áØ  
        Prewarm an index in the table.

        This is a hint to the database that the index will be accessed in the
        future and should be loaded into memory if possible.  This can reduce
        cold-start latency for subsequent queries.

        This call initiates prewarming and returns once the request is accepted.
        It is idempotent and safe to call from multiple clients concurrently.

        It is generally wasteful to call this if the index does not fit into the
        available cache.  Not all index types support prewarming; unsupported
        indices will silently ignore the request.

        Parameters
        ----------
        name: str
            The name of the index to prewarm
        )r'   r  r  Úprewarm_indexr½  s     rh   rs  zLanceTable.prewarm_indexA  s"   € ô( �x‰x˜Ÿ™×1Ñ1°$Ó7Ó8Ð8rj   c                ó^   — t        j                  | j                  j                  |«      «      S )án  
        Prewarm data for the table.

        This is a hint to the database that the given columns will be accessed
        in the future and the database should prefetch the data if possible.
        Currently only supported on remote tables.

        This call initiates prewarming and returns once the request is accepted.
        It is idempotent and safe to call from multiple clients concurrently.

        This operation has a large upfront cost but can speed up future queries
        that need to fetch the given columns.  Large columns such as embeddings
        or binary data may not be practical to prewarm.  This feature is intended
        for workloads that issue many queries against the same columns.

        Parameters
        ----------
        columns: list of str, optional
            The columns to prewarm. If None, all columns are prewarmed.
        )r'   r  r  Úprewarm_datarx  s     rh   rv  zLanceTable.prewarm_dataW  s"   € ô* �x‰x˜Ÿ™×0Ñ0°Ó9Ó:Ð:rj   r¿  c                ó`   — t        j                  | j                  j                  ||«      «      S r¨   )r'   r  r  rÆ  rÃ  s      rh   rÆ  zLanceTable.wait_for_indexn  s$   € ô �x‰x˜Ÿ™×2Ñ2°;ÀÓHÓIÐIrj   c                ó\   — t        j                  | j                  j                  «       «      S r¨   )r'   r  r  rÉ  rG  s    rh   rÉ  zLanceTable.statss  s   € Ü�x‰x˜Ÿ™×)Ñ)Ó+Ó,Ð,rj   c                ó\   — t        j                  | j                  j                  «       «      S r¨   )r'   r  r  rì   rG  s    rh   rì   zLanceTable.uriv  s   € ä�x‰x˜Ÿ™Ÿ™Ó)Ó*Ð*rj   c                ó\   — t        j                  | j                  j                  «       «      S )á¯  Get the initial storage options that were passed in when opening this table.

        For dynamically refreshed options (e.g., credential vending), use
        :meth:`latest_storage_options`.

        Warning: This is an internal API and the return value is subject to change.

        Returns
        -------
        Optional[Dict[str, str]]
            The storage options, or None if no storage options were configured.
        )r'   r  r  Úinitial_storage_optionsrG  s    rh   r|  z"LanceTable.initial_storage_optionsz  s    € ô �x‰x˜Ÿ™×;Ñ;Ó=Ó>Ð>rj   c                ó\   — t        j                  | j                  j                  «       «      S )á
  Get the latest storage options, refreshing from provider if configured.

        This method is useful for credential vending scenarios where storage options
        may be refreshed dynamically. If no dynamic provider is configured, this
        returns the initial static options.

        Warning: This is an internal API and the return value is subject to change.

        Returns
        -------
        Optional[Dict[str, str]]
            The storage options, or None if no storage options were configured.
        )r'   r  r  Úlatest_storage_optionsrG  s    rh   r  z!LanceTable.latest_storage_options‰  s    € ô �x‰x˜Ÿ™×:Ñ:Ó<Ó=Ð=rj   z0.25.0zDUse create_index() with config=BTree()/Bitmap()/LabelList() instead.rn  rÊ  rË  c          	     ó*  — |dk(  rt        j                  dt        d¬«       d}|dk(  rt        «       }n.|dk(  rt	        «       }n|dk(  rt        «       }nt        d|› �«      ‚t        j                  | j                  j                  |||||¬	«      «      S )
zéCreate a scalar index on a column.

        .. deprecated:: 0.25.0
            Use :meth:`create_index` with a BTree, Bitmap, or LabelList config instead.
            Example: ``table.create_index("column", config=BTree())``
        r±  z6index_type="scalar" is deprecated; use "BTREE" insteadr   r„   rÊ  ÚBITMAPÚ
LABEL_LISTrŒ  )r§  rw  r¨  rù   )rˆ   r‰   r‹   r7   r;   r=   ró   r'   r  r  r¬  )rH  r$  r§  rŽ  r¨  rù   rw  s          rh   rÍ  zLanceTable.create_scalar_index™  sŸ   € ð( ˜Ò!Ü�M‰MØHÜ"Øõð
 !ˆJØ˜Ò Ü“W‰FØ˜8Ò#Ü“X‰FØ˜<Ò'Ü“[‰FäÐ2°:°,Ð?Ó@Ð@Ü�x‰xØ�K‰K×$Ñ$ØØØØ)Øð %ó ó
ð 	
rj   z-Use create_index() with config=FTS() instead.rÎ  r’  r“  r”  rƒ   rÏ  rÐ  c               óø  — | j                  «        |rt        d«      ‚|�t        d«      ‚|dk7  rt        d«      ‚t        |t        «      st        d«      ‚|€||	||
||||||||dœ}n| j	                  |«      }||d<   t        d||d	œ|¤Ž}	 t        j                  | j                  j                  |||||¬
«      «       y# t        t        f$ r)}t        ||j                  |j                  ¬«       |‚d}~ww xY w)zßCreate a full-text search index on a column.

        .. deprecated:: 0.25.0
            Use :meth:`create_index` with an FTS config instead.
            Example: ``table.create_index("text_column", config=FTS())``
        z^Tantivy-based FTS has been removed. Remove use_tantivy and recreate the index with native FTS.NzXordering_field_names was only supported by the removed Tantivy-based FTS implementation.rÎ  zTwriter_heap_size was only supported by the removed Tantivy-based FTS implementation.z”Native FTS indexes can only be created on a single field at a time. To search over multiple text fields, create a separate FTS index for each field.)r    r¥   rÔ  r•  r–  r—  r˜  rÕ  r™  rš  r›  rœ  rÕ  )rÖ  r×  )r§  rw  rù   r¨  ©r    r¥   re   )r—  ró   rn   ro   r¥  rB   r'   r  r  r¬  rt   r®   r    r¥   )rH  rÙ  rÑ  r§  rÒ  rÓ  r£  rÔ  r    r¥   r•  r–  r—  r˜  rÕ  r™  rš  r›  rœ  rÖ  r×  r¨  rù   Útokenizer_configsrw  r*  s                             rh   rÚ  zLanceTable.create_fts_indexÆ  s^  € ðL 	×(Ñ(Ô*áÜðMóð ð  Ð+Üð4óð ð Ð1Ò1Üð4óð ô ˜+¤sÔ+Üð5óð ð Ð!à"0Ø$Ø!.Ø$4Ø(ØØ%6Ø%6Ø!.Ø$4Ø$4Ø*ñ!Ñð !%× <Ñ <¸^Ó LÐØ5FÐÐ1Ñ2äð 
Ø!Ø!5ñ
ð  ñ
ˆð	Ü�H‰HØ—‘×(Ñ(ØØ#Ø!ØØ!-ð )ó õøô œLÐ)ò 	Ü%ØØ%×4Ñ4ØŸ™õð
 ˆGûð	ús   Â3C ÃC9Ã$C4Ã4C9c                óà   — t        |«      \  }}	 t        j                  | j                  j	                  |||||||¬«      «      |r|j                  «        S S # |r|j                  «        w w xY w)a†  Add data to the table.
        If vector columns are missing and the table
        has embedding functions, then the vector columns
        are automatically computed and added.

        Parameters
        ----------
        data: list-of-dict, pd.DataFrame
            The data to insert into the table.
        mode: str
            The mode to use when writing the data. Valid values are
            "append" and "overwrite". Overwrite adopts explicitly declared blob
            layouts, while inferred bytes retain the existing blob v2 fields.
        on_bad_vectors: str, default "error"
            How to handle vectors with incorrect sizes, NaNs, or null elements.
            One of "error", "drop", "fill", "null".
        fill_value: float, default 0.
            The value to use when filling vectors. Only used if on_bad_vectors="fill".
        progress: bool, callable, or tqdm-like, optional
            A callback or tqdm-compatible progress bar. See
            :meth:`Table.add` for details.
        write_parallelism: int, optional
            Number of partitions to write in parallel. Higher values increase
            throughput but also peak memory use, since each partition buffers
            data in flight. Defaults to an estimate based on the data size,
            capped at the number of CPU cores. Lower this if bulk ingestion is
            using too much memory.
        allow_external_blob_outside_bases: bool, default False
            Allow blob URIs outside registered bases. See :meth:`Table.add`.
            Local tables only.

        Returns
        -------
        int
            The number of vectors in the table.
        ©rÜ  r[  r\  rA  rÝ  rÞ  )rB  r'   r  r  rß  Úclose)	rH  rë   rÜ  r[  r\  rA  rÝ  rÞ  Úownss	            rh   rß  zLanceTable.add/  su   € ô\ -¨XÓ6‰ˆ�$ð	!Ü—8‘8Ø—‘—‘ØØØ#1Ø)Ø%Ø&7Ø6Wð  ó ó
ñ Ø—‘Õ ð ø‰tØ—‘Õ ð ús   �4A ÁA-c                óÄ   — t        |t        «      r|j                  «       }nt        ||«      }| j                  «       j	                  ||||¬«       | j                  «        y)a±  Merge another table into this table.

        Performs a left join, where the dataset is the left side and other_table
        is the right side. Rows existing in the dataset but not on the left will
        be filled with null values, unless Lance doesn't support null values for
        some types, in which case an error will be raised. The only overlapping
        column allowed is the join column. If other overlapping columns exist,
        an error will be raised.

        Parameters
        ----------
        other_table: LanceTable or Reader-like
            The data to be merged. Acceptable types are:
            - Pandas DataFrame, Pyarrow Table, Dataset, Scanner,
            Iterator[RecordBatch], or RecordBatchReader
            - LanceTable
        left_on: str
            The name of the column in the dataset to join on.
        right_on: str or None
            The name of the column in other_table to join on. If None, defaults to
            left_on.
        schema: pa.Schema or LanceModel, optional
            The schema of the other_table.
            If not provided, the schema is inferred from the data.

        Examples
        --------
        >>> import lancedb
        >>> import pyarrow as pa
        >>> df = pa.table({'x': [1, 2, 3], 'y': ['a', 'b', 'c']})
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("dataset", df)
        >>> table.to_pandas()
           x  y
        0  1  a
        1  2  b
        2  3  c
        >>> new_df = pa.table({'x': [1, 2, 3], 'z': ['d', 'e', 'f']})
        >>> table.merge(new_df, 'x')
        >>> table.to_pandas()
           x  y  z
        0  1  a  d
        1  2  b  e
        2  3  c  f
        )Úleft_onÚright_onr  N)rn   r  rn  rf  r-  r  )rH  Úother_tabler‹  rŒ  r  s        rh   r-  zLanceTable.mergen  s_   € ôh �k¤:Ô.Ø%×.Ñ.Ó0‰Kä(ØØóˆKð 	�‰‹×ÑØ °8ÀFð 	ô 	
ð 	×ÑÕrj   c                óp   — t        j                  «       j                  | j                  j                  «      S )á   
        Get the embedding functions for the table

        Returns
        -------
        funcs: Dict[str, EmbeddingFunctionConfig]
            A mapping of the vector column to the embedding function
            or empty dict if not configured.
        )r6   r,  r-  r  r;  rG  s    rh   r^  zLanceTable.embedding_functions®  s-   € ô )×5Ñ5Ó7×GÑGØ�K‰K× Ñ ó
ð 	
rj   c                 ó   — y r¨   re   rè  s          rh   rí  zLanceTable.search½  s   € ð #&rj   c                 ó   — y r¨   re   rè  s          rh   rí  zLanceTable.searchÈ  s   € ð  #rj   c                 ó   — y r¨   re   rè  s          rh   rí  zLanceTable.searchÓ  s   € ð #&rj   c                 ó   — y r¨   re   rè  s          rh   rí  zLanceTable.searchà  s   € ð "%rj   c           	     ó˜   — t        |t        «      rd}t        | j                  |||¬«      }t	        j
                  | |||||xs g |¬«      S )a0  Create a search query to find the nearest neighbors
        of the given query vector. We currently support [vector search](https://lancedb.com/docs/search/vector-search/)
        and [full-text search](https://lancedb.com/docs/search/full-text-search/).

        Examples
        --------
        >>> import lancedb
        >>> db = lancedb.connect("./.lancedb")
        >>> data = [
        ...    {"original_width": 100, "caption": "bar", "vector": [0.1, 2.3, 4.5]},
        ...    {"original_width": 2000, "caption": "foo",  "vector": [0.5, 3.4, 1.3]},
        ...    {"original_width": 3000, "caption": "test", "vector": [0.3, 6.2, 2.6]}
        ... ]
        >>> table = db.create_table("my_table", data)
        >>> query = [0.4, 1.4, 2.4]
        >>> (table.search(query)
        ...     .where("original_width > 1000", prefilter=True)
        ...     .select(["caption", "original_width", "vector"])
        ...     .limit(2)
        ...     .to_pandas())
          caption  original_width           vector  _distance
        0     foo            2000  [0.5, 3.4, 1.3]   5.220000
        1    test            3000  [0.3, 6.2, 2.6]  23.089996

        Parameters
        ----------
        query: list/np.ndarray/str/PIL.Image.Image, default None
            The targeted vector to search for.

            - *default None*.
            Acceptable types are: list, np.ndarray, PIL.Image.Image

            - If None then the
            select/[where][lancedb.query.LanceQueryBuilder.where]/limit clauses
            are applied to filter the table
        vector_column_name: str, optional
            The name of the vector column to search.

            The vector column needs to be a pyarrow fixed size list type
            *default "vector"*

            - If not specified then the vector column is inferred from
            the table schema

            - If the table has multiple vector columns then the *vector_column_name*
            needs to be specified. Otherwise, an error is raised.
        query_type: str, default "auto"
            "vector", "fts", or "auto"
            If "auto" then the query type is inferred from the query;
            If `query` is a list/np.ndarray then the query type is "vector";
            If `query` is a PIL.Image.Image then either do vector search
            or raise an error if no corresponding embedding function is found.
            If the `query` is a string, then the query type is "vector" if the
            table has embedding functions, else the query type is "fts"
        fts_columns: str or list of str, default None
            The column(s) to search in for full-text search.
            If None then the search is performed on all indexed columns.
            For now, only one column can be searched at a time.

        Returns
        -------
        LanceQueryBuilder
            A query builder object representing the query.
            Once executed, the query returns selected columns, the vector,
            and also the "_distance" column which is the distance between the query
            vector and the returned vector.
        rŒ  ©r  ré  r4  rz  )rz  rê  rë  rì  )rn   rP   r[   r  rT   Úcreaterè  s          rh   rí  zLanceTable.searchë  s^   € ô\ �eœ]Ô+ØˆJÜ5Ø—;‘;Ø!ØØ1ô	
Ðô !×'Ñ'ØØØØ1Ø 3Ø#Ò) rØ#ô
ð 	
rj   )r  r	  rÞ   Úenable_v2_manifest_pathsr
  rf   rg   r  c
               óø  — |
€g }
| j                  | «      }||_        |
|_        ||_        ||_        |xs
 t        «       |_        ||_        |�%t        j                  dt        d¬«       |€i }||d<   |�<t        j                  dt        d¬«       |€i }t        |«      j                  «       |d<   t        j                  |j                  j                  j                  ||||||||	|
|||¬«      «      |_        |S )a)	  
        Create a new table.

        Examples
        --------
        >>> import lancedb
        >>> data = [
        ...    {"x": 1, "vector": [1.0, 2]},
        ...    {"x": 2, "vector": [3.0, 4]},
        ...    {"x": 3, "vector": [5.0, 6]}
        ... ]
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table", data)
        >>> table.to_pandas()
           x      vector
        0  1  [1.0, 2.0]
        1  2  [3.0, 4.0]
        2  3  [5.0, 6.0]

        Parameters
        ----------
        db: LanceDB
            The LanceDB instance to create the table in.
        name: str
            The name of the table to create.
        data: list-of-dict, dict, pd.DataFrame, default None
            The data to insert into the table.
            At least one of `data` or `schema` must be provided.
        schema: pa.Schema or LanceModel, optional
            The schema of the table. If not provided,
            the schema is inferred from the data.
            At least one of `data` or `schema` must be provided.
        mode: str, default "create"
            The mode to use when writing the data. Valid values are
            "create", "overwrite", and "append".
        exist_ok: bool, default False
            If the table already exists then raise an error if False,
            otherwise just open the table, it will not add the provided
            data but will validate against any schema that's specified.
        on_bad_vectors: str, default "error"
            How to handle vectors with incorrect sizes, NaNs, or null elements.
            One of "error", "drop", "fill", "null".
        fill_value: float, default 0.
            The value to use when filling vectors. Only used if on_bad_vectors="fill".
        embedding_functions: list of EmbeddingFunctionModel, default None
            The embedding functions to use when creating the table.
        data_storage_version: optional, str, default "stable"
            Deprecated.  Set `storage_options` when connecting to the database and set
            `new_table_data_storage_version` in the options.
        enable_v2_manifest_paths: optional, bool, default False
            Deprecated.  Set `storage_options` when connecting to the database and set
            `new_table_enable_v2_manifest_paths` in the options.
        zbsetting data_storage_version directly on create_table is deprecated. Use database_options instead.r   r„   Únew_table_data_storage_versionzfsetting enable_v2_manifest_paths directly on create_table is deprecated. Use database_options instead.Ú"new_table_enable_v2_manifest_paths)
r  rÜ  Úexist_okr[  r\  r^  r  r	  r
  rf   )Ú__new__r†  r  r  r  r  r  r  rˆ   r‰   r‹   ro   rt  r'   r  Úcreate_tabler  )r"  r  rù   rë   r  rÜ  r›  r[  r\  r^  r  r	  rÞ   r—  r
  rf   rg   r  rH  s                      rh   r–  zLanceTable.createL  s*  € ðV Ð!ØˆNØ�{‰{˜3ÓˆØˆŒ
Ø-ˆÔØ!ˆŒØ!1ˆÔØ$7Ò$@¼3»5ˆÔ!Ø'=ˆÔ$àÐ+Ü�M‰Mð0ä"Øõ	ð Ð&Ø"$�Ø@TˆOÐ<Ñ=Ø#Ð/Ü�M‰Mð<ä"Øõ	ð Ð&Ø"$�ÜDGØ(óEç‰e‹gð Ð@ÑAô —h‘hØ�J‰J×Ñ×)Ñ)ØØØØØ!Ø-Ø%Ø$7Ø-Ø /Ø!Ø!1ð *ó ó
ˆŒð  ˆrj   c                óš   — t        |t        «      r|j                  n|}t        j                  | j
                  j                  |«      «      S r¨   )rn   rC   Ú_innerr'   r  r  r2  ©rH  r1  Ú	predicates      rh   r2  zLanceTable.deleteÊ  s4   € Ü$.¨u´dÔ$;�E—L’LÀˆ	Ü�x‰x˜Ÿ™×*Ñ*¨9Ó5Ó6Ð6rj   r3  c               ód   — t        j                  | j                  j                  |||¬«      «      S )aÔ  
        This can be used to update zero to all rows depending on how many
        rows match the where clause.

        Parameters
        ----------
        where: str or [Expr][lancedb.expr.Expr], optional
            The filter condition. Can be a SQL string or a type-safe
            [Expr][lancedb.expr.Expr] built with [col][lancedb.expr.col] and
            [lit][lancedb.expr.lit]. The filter must not be empty, or it will
            error.
        values: dict, optional
            The values to update. The keys are the column names and the values
            are the values to set.
        values_sql: dict, optional
            The values to update, expressed as SQL expression strings. These can
            reference existing columns. For example, {"x": "x + 1"} will increment
            the x column by 1.

        Returns
        -------
        UpdateResult
            - rows_updated: The number of rows that were updated
            - version: The new version number of the table after the update

        Examples
        --------
        >>> import lancedb
        >>> from lancedb.expr import col
        >>> import pandas as pd
        >>> data = pd.DataFrame({"x": [1, 2, 3], "vector": [[1.0, 2], [3, 4], [5, 6]]})
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table", data)
        >>> table.to_pandas()
           x      vector
        0  1  [1.0, 2.0]
        1  2  [3.0, 4.0]
        2  3  [5.0, 6.0]
        >>> table.update(where=col("x") == 2, values={"vector": [10.0, 10]})
        UpdateResult(rows_updated=1, version=2)
        >>> table.to_pandas()
           x        vector
        0  1    [1.0, 2.0]
        1  3    [5.0, 6.0]
        2  2  [10.0, 10.0]

        ©r1  Úupdates_sql)r'   r  r  r7  r6  s       rh   r7  zLanceTable.updateÎ  s*   € ôl �x‰x˜Ÿ™×*Ñ*¨6¸ÈJÐ*ÓWÓXÐXrj   r  c               óÞ  ‡— t        | j                  | j                  «      rh| j                  s\| j	                  «       €L|j
                  €@|j                  €4ddlm} | j                  | j                  gz   } || j                  ||«      S t        j                  | j                  j                  |||¬«      «      Šˆfd„}t        j                   j#                  ‰j$                   |«       «      S )Nr   ©Ú_execute_server_side_queryr  c               3  óz   •K  — 	 	 t        j                  ‰ j                  «       «      –— Œ&# t        $ r Y y w xY w­wr¨   )r'   r  Ú	__anext__ÚStopAsyncIteration)Ú
async_iters   €rh   Ú	iter_syncz,LanceTable._execute_query.<locals>.iter_sync"  s=   øè ø€ ðØÜŸ(™( :×#7Ñ#7Ó#9Ó:Ò:ð øä%ò Ùðüs   ƒ;…', ¬	8µ;·8¸;)ri   r  r  r  rY  rñ  Úsearch_effortÚlancedb.namespacer§  r  rù   r'   r  r  r  r  r.  r/  r  )rH  r4  rÓ   rÅ  r§  r0  r¬  r«  s          @rh   r  zLanceTable._execute_query  sÎ   ø€ ô *Ø×&Ñ&¨×(AÑ(Aôð ×0Ò0Ø×#Ñ#Ó%Ð-Ø×"Ñ"Ð*Ø×#Ñ#Ð+åDà×+Ñ+¨t¯y©y¨kÑ9ˆHÙ-¨d×.DÑ.DÀhÐPUÓVÐVä—X‘XØ�K‰K×&Ñ& u¸ÈWÐ&ÓUó
ˆ
ô	ô ×#Ñ#×0Ñ0°×1BÑ1BÁIÃKÓPÐPrj   c                ó`   — t        j                  | j                  j                  ||«      «      S r¨   )r'   r  r  r!  r  s      rh   r!  zLanceTable._explain_plan+  s"   € Ü�x‰x˜Ÿ™×1Ñ1°%¸ÓAÓBÐBrj   r"  r#  c               ób   — t        j                  | j                  j                  ||¬«      «      S )Nr#  )r'   r  r  r'  r&  s      rh   r'  zLanceTable._analyze_plan.  s-   € ô �x‰xØ�K‰K×%Ñ% eÐATÐ%ÓUó
ð 	
rj   c                ó^   — t        j                  | j                  j                  |«      «      S r¨   )r'   r  r  r*  r)  s     rh   r*  zLanceTable._output_schema8  s    € Ü�x‰x˜Ÿ™×2Ñ2°5Ó9Ó:Ð:rj   c                ód   — t        j                  | j                  j                  ||||«      «      S r¨   )r'   r  r  r/  r,  s        rh   r/  zLanceTable._do_merge;  s-   € ô �x‰xØ�K‰K×!Ñ! %¨°>À:ÓNó
ð 	
rj   c                ó.   — | j                   j                  S r¨   )r  rŸ  rG  s    rh   rŸ  zLanceTable._innerF  s   € à�{‰{×!Ñ!Ð!rj   z0.21.0zUse `Table.optimize` instead.r8  c               óD   — | j                  «       j                  ||¬«      S )aõ  
        Clean up old versions of the table, freeing disk space.

        Parameters
        ----------
        older_than: timedelta, default None
            The minimum age of the version to delete. If None, then this defaults
            to two weeks.
        delete_unverified: bool, default False
            Because they may be part of an in-progress transaction, files newer
            than 7 days old are not deleted by default. If you are sure that
            there are no in-progress transactions, then you can set this to True
            to delete all files older than `older_than`.

        Returns
        -------
        CleanupStats
            The stats of the cleanup operation, including how many bytes were
            freed.
        r8  )rn  r=  r;  s      rh   r=  zLanceTable.cleanup_old_versionsJ  s(   € ð> �}‰}‹×3Ñ3ØÐ*;ð 4ó 
ð 	
rj   c                óz   —  | j                  «       j                  j                  |i |¤Ž}| j                  «        |S )aa  
        Run the compaction process on the table.

        This can be run after making several small appends to optimize the table
        for faster reads.

        Arguments are passed onto `lance.dataset.DatasetOptimizer.compact_files`.
         (see Lance documentation for more details) For most cases, the default
        should be fine.
        )rn  rE  r?  r  )rH  r”   rh  rÉ  s       rh   r?  zLanceTable.compact_filesm  s8   € ð  7�—‘“×(Ñ(×6Ñ6¸ÐGÀÑGˆØ×ÑÔØˆrj   r@  c               óx   — t        j                  | j                  j                  t	        ||«      ||«      «       yrC  )r'   r  r  Ú_do_optimizer�   rD  s        rh   rE  zLanceTable.optimize�  s4   € ôx 	�‰Ø�K‰K×$Ñ$Ü*Ð+=¸wÓGØ!Ø"óõ	
rj   c                ó\   — t        j                  | j                  j                  «       «      S )úQ
        List all indices that have been created with Self::create_index
        )r'   r  r  rG  rG  s    rh   rG  zLanceTable.list_indicesÅ  s    € ô �x‰x˜Ÿ™×0Ñ0Ó2Ó3Ð3rj   rH  c               ód   — t        j                  | j                  j                  |||¬«      «      S )rK  rH  )r'   r  r  rM  rL  s       rh   rM  zLanceTable.tokenizeË  s.   € ô( �x‰xØ�K‰K× Ñ  ¨vÀ*Ð ÓMó
ð 	
rj   c                ó^   — t        j                  | j                  j                  |«      «      S )rO  )r'   r  r  rQ  rP  s     rh   rQ  zLanceTable.index_statsã  s"   € ô �x‰x˜Ÿ™×/Ñ/°
Ó;Ó<Ð<rj   rR  c               óf   — t        j                  | j                  j                  ||||¬«      «      S )NrR  )r'   r  r  rY  rW  s        rh   rY  zLanceTable.add_columnsó  s8   € ô �x‰xØ�K‰K×#Ñ#ØØ!Ø%9Ø.Kð	 $ó ó
ð 	
rj   c                ó^   — t        j                  | j                  j                  |«      «      S )z¦Fill a computed column's unfilled rows and recompute those whose
        inputs changed. See
        [`AsyncTable.refresh_column`][lancedb.AsyncTable.refresh_column].)r'   r  r  r\  r[  s     rh   r\  zLanceTable.refresh_column	  s"   € ô �x‰x˜Ÿ™×2Ñ2°6Ó:Ó;Ð;rj   c                óp   — t        t        j                  | j                  j	                  |«      «      «      S )zÞFill a computed column's unfilled rows and recompute those whose
        inputs changed, returning a handle to the refresh job. See
        [`Table.refresh_column_async`][lancedb.table.Table.refresh_column_async].
        )r*   r'   r  r  r^  r[  s     rh   r^  zLanceTable.refresh_column_async  s'   € ô
 ”4—8‘8˜DŸK™K×<Ñ<¸VÓDÓEÓFÐFrj   c                ód   — t        j                  | j                  j                  |||¬«      «      S )z‰The per-row errors Function refreshes recorded on this table. See
        [`Table.function_errors`][lancedb.table.Table.function_errors].©ra  r$  rb  )r'   r  r  rc  r`  s       rh   rc  zLanceTable.function_errors  s.   € ô �x‰xØ�K‰K×'Ñ'¨v¸fÈEÐ'ÓRó
ð 	
rj   c                óZ   — t        j                   | j                  j                  |Ž «      S r¨   )r'   r  r  rg  re  s     rh   rg  zLanceTable.alter_columns"  s%   € ô �x‰xÐ1˜Ÿ™×1Ñ1°;Ð?Ó@Ð@rj   c                óZ   — t        j                   | j                  j                  |Ž «      S r¨   )r'   r  r  rk  ri  s     rh   rk  z LanceTable.update_field_metadata'  s%   € ô �x‰xÐ9˜Ÿ™×9Ñ9¸7ÐCÓDÐDrj   c                ó^   — t        j                  | j                  j                  |«      «      S r¨   )r'   r  r  rü  rx  s     rh   rü  zLanceTable.drop_columns,  s    € Ü�x‰x˜Ÿ™×0Ñ0°Ó9Ó:Ð:rj   c                ó^   — t        j                  | j                  j                  |«      «      S )z…Set the unenforced primary key. See
        [`AsyncTable.set_unenforced_primary_key`][lancedb.AsyncTable.set_unenforced_primary_key].)r'   r  r  Úset_unenforced_primary_keyrx  s     rh   rÅ  z%LanceTable.set_unenforced_primary_key/  s"   € ô �x‰x˜Ÿ™×>Ñ>¸wÓGÓHÐHrj   c                ó^   — t        j                  | j                  j                  |«      «      S )z^Install an RTEWriteSpec. See
        [`AsyncTable.enable_rte`][lancedb.AsyncTable.enable_rte].)r'   r  r  Ú
enable_rte©rH  Úspecs     rh   rÇ  zLanceTable.enable_rte4  s"   € ô �x‰x˜Ÿ™×.Ñ.¨tÓ4Ó5Ð5rj   c                ó\   — t        j                  | j                  j                  «       «      S )z`Remove the RTEWriteSpec. See
        [`AsyncTable.disable_rte`][lancedb.AsyncTable.disable_rte].)r'   r  r  Údisable_rterG  s    rh   rË  zLanceTable.disable_rte9  ó    € ô �x‰x˜Ÿ™×/Ñ/Ó1Ó2Ð2rj   c                ó\   — t        j                  | j                  j                  «       «      S )zwRead the installed RTEWriteSpec, or ``None``. See
        [`AsyncTable.get_rte_spec`][lancedb.AsyncTable.get_rte_spec].)r'   r  r  Úget_rte_specrG  s    rh   rÎ  zLanceTable.get_rte_spec>  s    € ô �x‰x˜Ÿ™×0Ñ0Ó2Ó3Ð3rj   c                ó\   — t        j                  | j                  j                  «       «      S )z`Synchronous version of
        [`AsyncTable.checkpoint_rte`][lancedb.AsyncTable.checkpoint_rte].)r'   r  r  Úcheckpoint_rterG  s    rh   rÐ  zLanceTable.checkpoint_rteC  s    € ô �x‰x˜Ÿ™×2Ñ2Ó4Ó5Ð5rj   c                ó\   — t        j                  | j                  j                  «       «      S )zVSynchronous version of
        [`AsyncTable.flush_rte`][lancedb.AsyncTable.flush_rte].)r'   r  r  Ú	flush_rterG  s    rh   rÒ  zLanceTable.flush_rteH  s    € ô �x‰x˜Ÿ™×-Ñ-Ó/Ó0Ð0rj   c                ó\   — t        j                  | j                  j                  «       «      S )zZSynchronous version of
        [`AsyncTable.compact_rte`][lancedb.AsyncTable.compact_rte].)r'   r  r  Úcompact_rterG  s    rh   rÔ  zLanceTable.compact_rteM  rÌ  rj   ©Úinclude_sstable_rowsc               ó`   — t        j                  | j                  j                  |¬«      «      S )z^Synchronous version of
        [`AsyncTable.get_rte_stats`][lancedb.AsyncTable.get_rte_stats].rÕ  )r'   r  r  Úget_rte_stats©rH  rÖ  s     rh   rØ  zLanceTable.get_rte_statsR  s+   € ô �x‰xØ�K‰K×%Ñ%Ð;OÐ%ÓPó
ð 	
rj   c                ó\   — t        j                  | j                  j                  «       «      S )zsClose cached RTE shard writers. See
        [`AsyncTable.close_rte_writers`][lancedb.AsyncTable.close_rte_writers].)r'   r  r  Úclose_rte_writersrG  s    rh   rÛ  zLanceTable.close_rte_writersY  s    € ô �x‰x˜Ÿ™×5Ñ5Ó7Ó8Ð8rj   c                ó\   — t        j                  | j                  j                  «       «      S )rš  )r'   r  r  r›  rG  s    rh   r›  z!LanceTable.uses_v2_manifest_paths^  s    € ô �x‰x˜Ÿ™×:Ñ:Ó<Ó=Ð=rj   c                ó^   — t        j                  | j                  j                  «       «       y)az  
        Migrate the manifest paths to the new format.

        This will update the manifest to use the new v2 format for paths.

        This function is idempotent, and can be run multiple times without
        changing the state of the object store.

        !!! danger

            This should not be run while other concurrent operations are happening.
            And it should also run until completion before resuming other operations.

        You can use
        [LanceTable.uses_v2_manifest_paths][lancedb.table.LanceTable.uses_v2_manifest_paths]
        to check if the table is already using the new path style.
        N)r'   r  r  Úmigrate_manifest_paths_v2rG  s    rh   r�  z$LanceTable.migrate_v2_manifest_pathsi  s   € ô$ 	�‰�—‘×6Ñ6Ó8Õ9rj   rl  rm  c                ób   — t        j                  | j                  j                  ||«      «       y©aR  
        Replace the metadata of a field in the schema

        .. deprecated:: 0.33.1
            Use :func:`update_field_metadata` instead.

        Parameters
        ----------
        field_name: str
            The name of the field to replace the metadata for
        new_metadata: dict
            The new metadata to set
        N)r'   r  r  rv  rt  s      rh   rv  z!LanceTable.replace_field_metadata}  s!   € ô& 	�‰�—‘×3Ñ3°JÀÓMÕNrj   )r  z'LanceDBConnection'rù   ro   r  rÆ  r	  ré  r{  rÌ   r
  r¬  rf   úOptional[Any]r  r½  rg   úOptional[set]r  rÎ   r  r  r¢  r¤  )r  ÚLanceDBTable)r  rÆ  r	  ré  r{  rÌ   r
  r¬  rf   rá  r  r½  rg   râ  r²  r¦  rþ  r¥  rÒ  rÕ  rÖ  r×  rÚ  rÛ  rÜ  r¨  rª  r«  r¨   )rJ  ú'AsyncTable'rO  rÌ   r£  ú'LanceTable'rü  rý  r®  ©é   ©r£  r±  r¯  ©rg  r%   r£  z'pd.DataFrame'r°  r³  r¶  r¹  rº  r»  r¼  r¾  ©r  rÆ  r£  r¸  r¿  rÁ  ©r£  ré  rÃ  rÄ  rÇ  rÊ  rå  )r�  zUnion[LanceTable, DATA]r‹  ro   rŒ  r¬  r  z&Optional[Union[pa.Schema, LanceModel]]r­  )NNÚvectorNNN)r4  ú3Optional[Union[VEC, str, 'PIL.Image.Image', Tuple]]rz  r¬  ré  úLiteral['vector']rê  r¬  rë  rÅ  rì  r½  r£  rU   )NNrŒ  NNN)r4  rí  rz  r¬  ré  úLiteral['fts']rê  r¬  rë  rÅ  rì  r½  r£  rR   )NNÚhybridNNN)r4  rÑ  rz  r¬  ré  úLiteral['hybrid']rê  r¬  rë  rÅ  rì  r½  r£  rS   rÎ  )r4  r¸  rz  r¬  ré  rÁ   rê  r¬  rë  rÅ  rì  r½  r£  rQ   rÐ  )NNr–  FrÈ  rÉ  N)"r  r¯   rù   ro   rë   zOptional[DATA]r  úOptional[pa.Schema]rÜ  rÄ   r›  rÎ   r[  rÂ   r\  rÐ   r^  z'Optional[List[EmbeddingFunctionConfig]]r  rÆ  r	  zOptional[Dict[str, str | bool]]rÞ   r¬  r—  r½  r
  r¬  rf   rá  rg   râ  r  rÎ   rä  ræ  rÝ  rß  rà  rá  râ  rã  )r£  rã  rê  )r£  r³   rë  rí  rî  rï  )
rX  rð  rS  rñ  rT  rò  rU  ró  r£  rµ   rô  rõ  rö  r÷  )rf  rø  r£  r¸   rù  rû  ©r  rÍ  r£  r¸  ©rÉ  z'RTEWriteSpec'r£  r¸  r   ©r£  zOptional['RTEWriteSpec']©rÖ  rÎ   r£  rè  rÿ  rú  )`rà   rá   râ   rã   r  r  rù   rJ  Úclassmethodr!  r+  r	   r-  rn  r  r„  rO  rñ  r  r  r  r  r  r  rS  rV  rY  rK  r|  r  r�  r[  rR  rT  rV  rf  rA  rp  r   r¬  r4   r»  r¾  rs  rv  r   rÆ  rÉ  rì   r|  r  r  r  r   rÍ  rO   r  rÚ  rß  r-  r^  rí  r–  r2  r7  r  r!  r'  r*  r/  rŸ  r=  r?  rE  rG  rM  rQ  rY  r\  r^  rc  rg  rk  rü  rÅ  rÇ  rË  rÎ  rÐ  rÒ  rÔ  rØ  rÛ  r›  r�  rv  re   rj   rh   r  r  7  sò  „ ñð& /3Ø48Ø*.Ø"&Ø*.Ø-1Ø-1Ø',Ø!ñ-Eà'ð-Eð ð-Eð
 ,ð-Eð 2ð-Eð (ð-Eð  ð-Eð (ð-Eð +ð-Eð +ð-Eð !%ð-Eð ó-Eð^ ò ó ð ð ò$ó ð$ð ò
ó ð
ð ð /3Ø48Ø*.Ø"&Ø*.Ø-1Ø-1ñ#ð
 ,ð#ð 2ð#ð (ð#ð  ð#ð (ð#ð +ð#ð +ò#ó ð#ðJ ò6ó ð6ó%ðN ò.ó ð.ó5ð ò/ó ð/ð
 :?ñØ ðØ26ðà	óð :?ñØ ðØ26ðà	óó4ðBàðBð GðBð 
ó	BðOàðOð *ðOð 
ó	OðGàðGð GðGð 
$ó	Gð@Ø<ð@à	ó@ð
 ò$!ó ð$!ðL òó ðó,ð
 CGð
Ø'ð
Ø2?ð
à	ó
ó $0òL0ô.(ô`8óVóô-ô!HðF 17õ 0ô6 
ðF ð Ø,/Ø!Øñ
àð
ð
  ð
ð ð
ð *ð
ð ð
ð ð
ð 
ò
ó ð
ð ð =@Ø(+Ø),Ø"%ØØ%(Ø*-Øð Ø!ØØØ"ð!ð$ -0Ø!ØØ/2ñ+à9ðð &ðð 'ð	ð
  ðð ðð #ðð (ðð ðð
ðð ðð ðð ðð  ð!ð$ *ð%ð& ð'ð( ð)ð*  -ð+ð, 
ò-ó ðð4 Ø(,Ø)-Ø"4ØØ%)Ø*.Øð Ø ØØØ"ð-}
ð0 -1Ø,0Ø"ØØ/3ñ9}
àð}
ð &ð}
ð 'ð	}
ð
  ð}
ð ð}
ð #ð}
ð (ð}
ð ð}
ð
ð}
ð& ð'}
ð( ð)}
ð* ð+}
ð, ð-}
ð0 *ð1}
ð2 *ð3}
ð4 ð5}
ð6 ð7}
ð8  -ó9}
ðH #'Ø,0Ø"Øñ
àð
ð  ð	
ð
  ð
ð *ð
ð ð
ð ð
ð 
ó
ó8	6ó9ô,;ñ0 @IÐQTÔ?UðJØ(ðJØ3<ðJà	óJó
-ð ò+ó ð+ó?ó>ð  €[×ÑØØ#ØVôð Ø&-Ø,0Ø"ñ&
àð&
ð ð	&
ð
 $ð&
ð *ð&
ð ò&
óð
&
ðP €[×ÑØØ#Ø?ôð AEØØ*<Ø!Ø(,Ø#à,4Ø!Ø*,ØØ#Ø,0Ø15Ø"Ø !Ø !Ø!ØØ4G×4KÑ4KØ,0Ø"ñ3bà*ðbð >ð	bð
 ðbð (ðbð ðbð &ðbð ðbð *ðbð ðbð (ðbð ðbð ðbð  *ð!bð" /ð#bð$ ð%bð& ð'bð( ð)bð* ð+bð, ð-bð. 2ð/bð0 *ð1bð2 ò3bóð
bðN !Ø+2ØØ9=Ø+/Ø27ð=!àð=!ð ð=!ð )ð	=!ð
 ð=!ð 7ð=!ð )ð=!ð ,0ð=!ð 
ó=!ðF #'Ø9=ð>à,ð>ð ð>ð  ð	>ð
 7ó>ð@ ò
ó ð
ð ð FJØ,0Ø(0Ø-1Ø7;Ø&*ð&àBð&ð *ð&ð &ð	&ð
 +ð&ð 5ð&ð $ð&ð 
!ò&ó ð&ð ð FJØ,0Ø%*Ø-1Ø7;Ø&*ð#àBð#ð *ð#ð #ð	#ð
 +ð#ð 5ð#ð $ð#ð 
ò#ó ð#ð ð
 Ø,0Ø(0Ø-1Ø7;Ø&*ð
&ð
ð
&ð
 *ð
&ð &ð
&ð +ð
&ð 5ð
&ð $ð
&ð 
!ò
&ó ð
&ð ð Ø,0Ø &Ø-1Ø7;Ø&*ð%àð%ð *ð%ð ð	%ð
 +ð%ð 5ð%ð $ð%ð 
 ò%ó ð%ð Ø,0Ø &Ø-1Ø7;Ø&*ð_
ð
ð_
ð
 *ð_
ð ð_
ð +ð_
ð 5ð_
ð $ð_
ð 
ó_
ðB ð
  $Ø&*Ø#ØØ+2ØØGKð{ð /3Ø;?Ø.2Ø37Ø"&Ø*.Ø-1Ø',ñ'{àð{ð ð{ð ð	{ð
 $ð{ð ð{ð ð{ð )ð{ð ð{ð Eð{ð ,ð{ð 9ð{ð ,ð{ð #1ð{ð   ð!{ð" (ð#{ð$ +ð%{ð& !%ò'{ó ð{óz7ð -1Ø!%ð6Yð
 04ñ6Yà)ð6Yð ð6Yð
 -ð6Yð 
ó6Yðx %)Ø'+ñ#Qàð#Qð "ð	#Qð
 %ð#Qð 
ó#QôJCð >Iñ	
àð
ð ;ð	
ð
 
ó
ó;ð	
à&ð	
ð ð	
ð )ð		
ð
 ð	
ð 
ó	
ð ò"ó ð"ð €[×ÑØØ#Ø/ôð +/ð
ð #(ñ	
à'ð
ð  ð	
ð
 
ò
óð

ð< €[×ÑØØ#Ø/ôò
óð
ð$ 37Ø"'ØØ:>ñB
ð 0ðB
ð  ð	B
ð
 ðB
ð 8óB
óH4ð !%Ø$(ñ
àð
ð ð	
ð
 "ð
ð 
ó
ó0=ð. ð
ð +/Ø,0Ø48ñ
ðð
ð (ð
ð *ð
ð (2ð
ð 
ó
ó,<óGð !%Ø $Ø#ð	

àð

ð ð

ð ð	

ð
 
ó

ðAØ4ðAà	óAð
EØ&ðEà	"óEó
;óIó
6ó
3ó
4ó
6ó
1ó
3ð
 =Bõ 
ó9ó
	>ò:ð( €[×ÑØØ#Ø6ôò
Oóñ
Orj   r  c                óÎ   ‡ ‡‡‡‡‡— t        ‰ j                  ‰|«      Š‰s‰ S t        ‰ j                  ‰«      Šˆˆˆˆ ˆˆfd„}t        j                  j                  ‰ |«       «      S )Nc               3  ó  •K  — ‰D �]  } g }‰
D ]D  }|d   }‰	�$|€"t        | |d      «      }|j                  |«       t        | |d   ‰‰||d   ¬«      } ŒF |D ]  }|d   �Œ	t        | |d      «      |d<   Œ | j                  j	                  ‰d¬«      r| –— Œ’t
        j                  j                  | g«      j                  ‰«      j                  «       }|sŒÒt
        j                  j                  |d   j                  ‰¬«      –— �Œ y ­w)	NÚexpected_dimrù   Úexpected_value_type)rz  r[  r\  rú  rû  Trh  r   r(  )Ú_infer_vector_dimr3  Ú_handle_bad_vector_columnr  ro  r  r°   r/  rM  rP  r:  rl  r  )rQ  Úpending_dimsr%  Údimrm  r\  r[  Úoutput_schemare  r]  Úvector_columnss        €€€€€€rh   rS  z _handle_bad_vectors.<locals>.gen   s@  øè ø€ Øó 	ˆEØˆLØ!/ò �Ø# NÑ3�Ø Ð,°°Ü+¨E°-ÀÑ2GÑ,HÓI�CØ ×'Ñ'¨Ô6Ü1ØØ'4°VÑ'<Ø#1Ø)Ø!$Ø(5Ð6KÑ(Lô‘ðð ".ò �Ø  Ñ0Ñ8Ü4EØ˜m¨FÑ3Ñ4ó5�M .Ò1ðð
 �|‰|×"Ñ" =ÀÐ"ÔFØ’Øô —‘×%Ñ% u gÓ.×3Ñ3°MÓB×MÑMÓOð ò Ü—n‘n×0Ñ0Ø  ‘O×+Ñ+Ø(ð 1ó ô ñ9	ùs   ƒADÁ A7DÃ4D)Ú_find_vector_columnsr  Ú_vector_output_schemar  r.  r/  )re  r[  r\  r]  r;  rS  r   r  s   ````  @@rh   r_  r_  “  sW   ý€ ô *¨&¯-©-¸ÈÓQ€NÙØˆä)¨&¯-©-¸ÓH€M÷ ñ  ôD ×Ñ×,Ñ,¨]¹C»EÓBÐBrj   c                ó‚  — |�€g }| D ]ÿ  }t        |j                  «      xrH t        j                  j	                  |j                  j
                  «      xr |j                  t        k(  }t        j                  j                  |j                  «      xrN t        j                  j	                  |j                  j
                  «      xr |j                  j                  dk\  }|s|sŒà|j                  |j                  d d dœ«       �Œ |S t        | j                  «      }t        |j                  |«      }t        t        j                   «       j#                  |«      j%                  «       «      }	g }|D �]Æ  }|j                  |vrŒt        |j                  «      r3t        j                  j	                  |j                  j
                  «      sŒ\| j'                  |j                  «      }
|j                  |	v xsO |j                  t        k(  xs: |j                  dk(  xr) t        j                  j                  |j                  «      }t        j                  j                  |
j                  «      xrN t        j                  j	                  |
j                  j
                  «      xr |
j                  j                  dk\  }|s|s�ŒU|j                  |j                  t        j                  j                  |j                  «      r|j                  j                  nd |j                  j
                  dœ«       �ŒÉ |S )Né
   )rù   rú  rû  Ú	embedding)r  rû   r  r{  Úis_floatingr�  rù   r4   r‚  r„  r3  r  r  rb  r;  r6   r,  r-  rõ   r  )Úreader_schemar]  r;  r  r  Únamed_vector_colÚlikely_vector_colÚreader_column_namesÚactive_metadataÚembedding_function_columnsÚreader_fieldÚtyped_fixed_vector_cols               rh   r  r  Å  sª  € ð
 ÑØˆØ"ò 	ˆEä˜eŸj™jÓ)ò 5Ü—H‘H×(Ñ(¨¯©×)>Ñ)>Ó?ò5à—J‘JÔ"4Ñ4ð ô —‘×+Ñ+¨E¯J©JÓ7ò 1Ü—H‘H×(Ñ(¨¯©×)>Ñ)>Ó?ò1à—Z‘Z×)Ñ)¨RÑ/ð ñ
  Ò#4Ø×%Ñ%à %§
¡
Ø(,Ø/3ñöð	ð& Ðä˜m×1Ñ1Ó2ÐÜ% m×&<Ñ&<¸hÓG€OÜ!$Ü!×.Ñ.Ó0×@Ñ@ÀÓQ×VÑVÓXó"Ðð €NØó ˆØ�:‰:Ð0Ñ0ØÜ˜UŸZ™ZÔ(´·±×0DÑ0DØ�J‰J×!Ñ!ô1
ð à$×*Ñ*¨5¯:©:Ó6ˆà�J‰JÐ4Ð4ò WØ�z‰zÔ/Ñ/òWà—
‘
˜kÑ)ÒU¬b¯h©h×.IÑ.IÈ%Ï*É*Ó.Uð 	ô �H‰H×'Ñ'¨×(9Ñ(9Ó:ò 2Ü—‘×$Ñ$ \×%6Ñ%6×%AÑ%AÓBò2à×!Ñ!×+Ñ+¨rÑ1ð 	ñ Ó5Ø×!Ñ!à!ŸJ™Jô Ÿ8™8×6Ñ6°u·z±zÔBð Ÿ
™
×,Ò,à!à+0¯:©:×+@Ñ+@ñö
ð+ðB Ðrj   c           	     ó|  — |D �ci c]  }|d   |“Œ
 }}g }| D ]}  }|j                  |j                  «      }|€|j                  }nt        ||«      }|j	                  t        j                  |j                  ||j                  |j                  «      «       Œ t        j                  || j                  ¬«      S c c}w )Nrù   rZ  )
r  rù   rû   Ú_vector_output_typer3  r  r  r‘  r;  r  )r  r  r$  Úcolumns_by_namers  r  Úoutput_types          rh   r  r    s«   € ð =KÖK°&�v˜f‘~ vÑ-ÐK€OÐKØ€FØò YˆØ ×$Ñ$ U§Z¡ZÓ0ˆØˆ>ØŸ*™*‰Kä-¨e°VÓ<ˆKØ�‰”b—h‘h˜uŸz™z¨;¸¿¹ÈÏÉÓWÕXðYô �9‰9�V m×&<Ñ&<Ô=Ð=ùò Ls   …B9c                ó®  — t        | j                  «      s| j                  S |d   �±t        j                  j	                  | j                  j
                  «      sft        j                  j                  | j                  j
                  «      s3t        j                  j                  | j                  j
                  «      rt        j                  |d   «      S |d   �nt        j                  j                  | j                  «      rE| j                  j                  |d   k7  r)t        j                  | j                  j
                  «      S | j                  S )Nrû  rú  )r  rû   r  r{  r¡  r�  Ú
is_integerÚis_unsigned_integerrƒ  r‚  r„  )r  r%  s     rh   r  r    sê   € Ü˜Ÿ™Ô$Ø�z‰zÐàÐ*Ñ+Ð7Ü
�‰×Ñ˜Ÿ™×.Ñ.Ô/Ü�8‰8×Ñ˜uŸz™z×4Ñ4Ô5Ü�8‰8×'Ñ'¨¯
©
×(=Ñ(=Ô>ä�x‰x˜Ð&;Ñ<Ó=Ð=ð 	�nÑ%Ð1Ü�H‰H×'Ñ'¨¯
©
Ô3Ø�J‰J× Ñ  M°.Ñ$AÒAä�x‰x˜Ÿ
™
×-Ñ-Ó.Ð.à�:‰:Ðrj   c                ó  — | j                   j                  |«      }| |   }t        |j                  «      s| S |�¡t        j
                  j                  |j                  «      rx|j                  j                  |k7  r_t	        j                  |j                  «       t	        j                  |j                  j                  «      ¬«      }| j                  |||«      } |�ät        j
                  j                  |j                  j                  «      sft        j
                  j                  |j                  j                  «      s3t        j
                  j                  |j                  j                  «      rKt	        j                  |j                  «       t	        j                  |«      ¬«      }| j                  |||«      } t        j
                  j!                  |j                  j                  «      rt#        |«      }n"t	        j                  dgt%        |«      z  «      }|�|}	nOt        j
                  j                  |j                  «      r|j                  j                  }	nt'        |«      }	|	€| S t)        j                  |«      }
t)        j*                  |
t)        j,                  t)        j.                  |«      |	«      «      }t)        j0                  |«      j3                  «       xs# t)        j0                  |«      j3                  «       }|rét)        j4                  ||«      }|dk(  rAt)        j0                  |«      j3                  «       rt7        d|› d�«      ‚t7        d|› d�«      ‚|dk(  r+t)        j8                  |t	        j:                  d«      |«      }n]|d	k(  r*| j=                  t)        j>                  |«      «      } | |   }n.|d
k(  r|€t7        d«      ‚tA        ||	|«      }nt7        d|› �«      ‚| j                  |||«      S )a  
    Ensure that the vector column exists and has type fixed_size_list(float)

    Parameters
    ----------
    data: pa.Table
        The table to sanitize.
    vector_column_name: str
        The name of the vector column.
    on_bad_vectors: str, default "error"
        How to handle vectors with incorrect sizes, NaNs, or null elements.
        One of "error", "drop", "fill", "null".
    fill_value: float, default 0.0
        The value to use when filling vectors. Only used if on_bad_vectors="fill".
    Nr	  FrÈ  zVector column 'zÂ' has variable length vectors. Set on_bad_vectors='drop' to remove them, set on_bad_vectors='fill' and fill_value=<value> to replace them, or set on_bad_vectors='null' to replace them with null.z¾' has NaNs or null values. Set on_bad_vectors='drop' to remove them, set on_bad_vectors='fill' and fill_value=<value> to replace them, or set on_bad_vectors='null' to replace them with null.ÚnullÚdropÚfillz;`fill_value` must not be None if `on_bad_vectors` is 'fill'z"Invalid value for on_bad_vectors: )!r  rì  r  rû   r  r{  r‚  r„  r  Ú	to_pylistrƒ  r�  r  r¡  r  r  r  Úhas_nan_valuesrq  rü  r¯  Ú	or_kleeneÚ	not_equalÚlist_value_lengthr¢   r®  Úor_ró   Úif_elser±  rc  ÚinvertÚ_fill_bad_vector_values)rë   rz  r[  r\  rú  rû  rî   Úvec_arrÚhas_nanrÿ  r¡  Úhas_wrong_dimÚhas_bad_vectorsÚis_bads                 rh   rý  rý  0  sC  € ð. × Ñ ×&Ñ&Ð'9Ó:€HØÐ%Ñ&€GÜ˜Ÿ™Ô&Øˆð 	Ð Ü�H‰H×'Ñ'¨¯©Ô5Ø�L‰L×"Ñ" lÒ2ä—(‘(˜7×,Ñ,Ó.´R·X±X¸g¿l¹l×>UÑ>UÓ5VÔWˆØ�‰˜xÐ);¸WÓEˆàÐ&Ü
�‰×Ñ˜Ÿ™×0Ñ0Ô1Ü�8‰8×Ñ˜wŸ|™|×6Ñ6Ô7Ü�8‰8×'Ñ'¨¯©×(?Ñ(?Ô@ä—(‘(˜7×,Ñ,Ó.´R·X±XÐ>QÓ5RÔSˆØ�‰˜xÐ);¸WÓEˆä	‡x�x×Ñ˜GŸL™L×3Ñ3Ô4Ü  Ó)‰ä—(‘(˜E˜7¤S¨£\Ñ1Ó2ˆàÐØ‰Ü	�‰×	$Ñ	$ W§\¡\Ô	2Ø�l‰l×$Ñ$‰ä Ó(ˆØˆ;ØˆKä�j‰j˜Ó!€Gô
 —L‘LØÜ
�‰”R×)Ñ)¨'Ó2°CÓ8ó€Mô
 —f‘f˜W“o×+Ñ+Ó-ÒN´·±¸Ó1F×1LÑ1LÓ1N€OáÜ—‘˜ Ó/ˆØ˜WÒ$Ü�v‰v�mÓ$×*Ñ*Ô,Ü Ø%Ð&8Ð%9ð :Nð Nóð ô !Ø%Ð&8Ð%9ð :Nð Nóð ð ˜vÒ%Ü—j‘jØÜ—	‘	˜$“Øó‰Gð
 ˜vÒ%Ø—;‘;œrŸy™y¨Ó0Ó1ˆDØÐ-Ñ.‰GØ˜vÒ%ØÐ!Ü ØQóð ô .¨g°s¸JÓG‰GäÐAÀ.ÐAQÐRÓSÐSà�?‰?˜8Ð%7¸ÓAÐArj   c                ó6  — t        | t        j                  «      st        j                  | g«      } | j	                  «       } t        j                  | d|d¬«      }|j                  }t        j                  |«      }t        j                  j                  |j                  «      rwt        j                  j                  |j                  «      r#|j                  t        j                  «       «      n|}t        j                  |t        j                   |«      «      }t        j"                  |«      j                  |j                  «      }t        j$                  |||«      }t        j&                  j)                  ||«      }	|	j                  | j                  «      S )Nr   T)Úreturn_fixed_size_list)rn   r  ÚChunkedArrayÚchunked_arrayrû  r¯  Ú
list_slicer«   r¡  r{  r  rû   Ú
is_float16rM  r.  r  Úis_nanr±  r!  r¬  rl  )
Úarrrÿ  r\  Úslicedr«   Ú
needs_fillÚvalues_for_nan_checkÚfill_scalarÚfilled_valuesÚfilleds
             rh   r#  r#  œ  s  € ô
 �cœ2Ÿ?™?Ô+Ü×Ñ ˜uÓ%ˆØ
×
Ñ
Ó
€Cô �]‰]˜3  3¸tÔD€Fà�]‰]€FÜ—‘˜FÓ#€JÜ	‡x�x×Ñ˜FŸK™KÔ(ä)+¯©×)<Ñ)<¸V¿[¹[Ô)IˆF�K‰KœŸ
™
›Ô%Èvð 	ô —\‘\ *¬b¯i©iÐ8LÓ.MÓNˆ
ä—)‘)˜JÓ'×,Ñ,¨V¯[©[Ó9€KÜ—J‘J˜z¨;¸Ó?€MÜ×"Ñ"×.Ñ.¨}¸cÓB€FØ�;‰;�s—x‘xÓ Ð rj   c                óž  — t        | t        j                  «      r<t        j                  | j                  D �cg c]  }|j                  «       ‘Œ c}«      }n| j                  «       }t        j                  j                  |j                  «      r7t        j                  |j                  t        j                  «       «      «      }nt        j                  |«      }t        j                  |d«      }t        j                  | «      }| j                  r=t        j                   |t        j"                  t        j$                  | «      |«      «      }t        j&                  t        j                   ||«      «      }t        j(                  t+        t-        | «      «      t        j.                  «       ¬«      }t        j0                  ||«      S c c}w )zJFind vectors with NaN or null components, including pandas-converted NaNs.Tr	  )rn   r  r+  r,  ÚchunksÚflattenr{  r.  rû   r¯  r/  rM  r.  Ú	fill_nullÚlist_parent_indicesr   rc  rú  Úis_validÚuniquer  r÷  rq  Úuint32Úis_in)r0  Úchunkr«   Úvalues_has_nanÚvalues_indicesÚhas_nan_indicesrþ  s          rh   r  r  ·  s#  € ä�#”r—‘Ô'Ü×!Ñ!ÀÇ
Á
Ö"K°u 5§=¡=¥?Ò"KÓL‰à—‘“ˆÜ	‡x�x×Ñ˜6Ÿ;™;Ô'ô Ÿ™ 6§;¡;¬r¯z©z«|Ó#<Ó=‰äŸ™ 6Ó*ˆô —\‘\ .°$Ó7€NÜ×+Ñ+¨CÓ0€NØ
‡~‚~äŸ™ØœBŸG™G¤B§K¡K°Ó$4°nÓEó
ˆô —i‘i¤§	¡	¨.¸.Ó IÓJ€OÜ�h‰h”uœS ›X“¬R¯Y©Y«[Ô9€GÜ�8‰8�G˜_Ó-Ð-ùò) #Ls   ¸G
c                óÄ   — t         j                  j                  | «      xs@ t         j                  j                  | «      xs t         j                  j	                  | «      S r¨   )r  r{  r  r…  r‚  rÁ  s    rh   r  r  Ñ  sG   € ä
�‰×Ñ˜Ó#ò 	2Ü�8‰8×!Ñ! )Ó,ò	2ä�8‰8×&Ñ& yÓ1ðrj   c                 óÜ   — i }| D ]d  }|€Œ|j                  «       D ]L  \  }}t        |t        «      r|j                  d«      }t        |t        «      r|j                  d«      }|||<   ŒN Œf |S )Nzutf-8)r<  rn   ro   Úencode)Úmetadata_dictsÚmergedr;  r  rü   s        rh   rb  rb  Ù  sy   € Ø€FØ"ò  ˆØÐØØ"Ÿ.™.Ó*ò 	 ‰JˆC�Ü˜#œsÔ#Ø—j‘j Ó)�Ü˜%¤Ô%ØŸ™ WÓ-�ØˆF�3ŠKñ	 ð ð €Mrj   c                ó6   — | j                  «       }d|v xs d|v S )z0Check if a field name indicates a vector column.rì  r  )rt  )rñ  Ú
name_lowers     rh   Ú_name_suggests_vector_columnrK  ç  s%   € à×!Ñ!Ó#€JØ�zÐ!Ò> [°JÐ%>Ð>rj   c                ó®  — | j                   }d }t        |«      D �]µ  \  }}t        j                  j	                  |j
                  «      xs) t        j                  j                  |j
                  «      }t        |j                  «      sŒq|sŒt|€t        | «      \  }} t        |j                  |«      «      }|€Œ¡t        j                  j                  |j
                  j                  «      r*t        j                  t        j                  «       |«      }�not        j                  j!                  |j
                  j                  «      �r9|j                  |«      }t#        |t        j$                  «      r|j'                  «       }|j)                  «       }	t+        j,                  |	d¬«      j/                  «       }
|
dk(  r)t        j                  t        j0                  «       |«      }n�t+        j2                  |	«      }|d   j/                  «       }|d   j/                  «       }|�|dk  s|�.|dkD  r)t        j                  t        j                  «       |«      }n+t        j                  t        j0                  «       |«      }n�Œmt        j4                  |j                  ||j6                  |j8                  ¬«      }|j;                  ||«      }�Œ¸ || fS )NÚ
only_valid)rÜ  r   ÚminÚmaxéÿ   )r‘  r;  )r  rè  r  r{  r  rû   r…  rK  rù   r&   Ú_modal_list_sizer$  r  r�  rƒ  r.  r  rn   r+  rû  r9  r¯  Úcountr®  Úuint8Úmin_maxr  r‘  r;  r  )re  r  Úpeekedr  r  Úis_list_typerÿ  r£  r«   Ú	flattenedÚvalid_countrT  Ú	min_valueÚ	max_valuer  s                  rh   r`  r`  í  s  € ð �]‰]€FØ€Fä˜fÓ%ó 4.‰ˆˆ5Ü—x‘x×'Ñ'¨¯
©
Ó3ò 
´r·x±x×7MÑ7MØ�J‰Jó8
ˆô (¨¯
©
Õ3ºØˆ~Ü!,¨VÓ!4‘�˜ä" 6§=¡=°Ó#3Ó4ˆCàˆ{ð ô �x‰x×#Ñ# E§J¡J×$9Ñ$9Ô:Ü Ÿh™h¤r§z¡z£|°SÓ9’Ü—‘×$Ñ$ U§Z¡Z×%:Ñ%:Õ;ØŸ™ qÓ)�ä˜f¤b§o¡oÔ6Ø#×2Ñ2Ó4�Fà"ŸN™NÓ,�	Ü Ÿh™h y°|ÔD×JÑJÓL�à !Ò#Ü"$§(¡(¬2¯8©8«:°sÓ";‘Kä Ÿj™j¨Ó3�GØ '¨¡× 4Ñ 4Ó 6�IØ '¨¡× 4Ñ 4Ó 6�Ià!Ð-°)¸a²-Ø!Ð-°)¸c²/ä&(§h¡h¬r¯z©z«|¸SÓ&A™ä&(§h¡h¬r¯x©x«z¸3Ó&?™áäŸ™Ø—
‘
ØØŸ™ØŸ™ô	ˆIð —Z‘Z  9Ó-ŠFði4.ðl �6ˆ>Ðrj   c                óœ   — t        j                  t        j                  | «      «      }t        |«      dk(  ry |d   j	                  «       d   S ©Nr   rÜ  )r¯  rÜ  r  rq  r®  )r0  Úmodess     rh   rQ  rQ  ,  sA   € ô �G‰G”B×(Ñ(¨Ó-Ó.€EÜ
ˆ5ƒz�Q‚ØØ�‰8�>‰>Ó˜FÑ#Ð#rj   c                ó  — t        | j                  «      sy t        j                  | «      }t        j                  |t        j
                  |d«      «      }t        |«      dk(  ry t        j                  |«      d   j                  «       d   S r\  )	r  rû   r¯  r  rc  Úgreaterrq  rÜ  r®  )r0  Úlengthss     rh   rü  rü  6  sm   € Ü˜Ÿ™Ô"ØÜ×"Ñ" 3Ó'€GÜ�i‰i˜¤§¡¨G°QÓ!7Ó8€GÜ
ˆ7ƒ|�qÒØÜ�7‰7�7Ó˜AÑ×$Ñ$Ó& vÑ.Ð.rj   c                óH   — | j                   �t        | j                   «       yy)z.
    Make sure the metadata is valid utf8
    N)r;  Ú_validate_metadatar(  s    rh   rc  rc  @  s   € ð ‡�Ð"Ü˜6Ÿ?™?Õ+ð #rj   c                óê   — | j                  «       D ]D  \  }}t        |t        «      r	 |j                  d«       Œ)t        |t        «      sŒ:t        |«       ŒF y# t        $ r t        d|› d�«      ‚w xY w)zo
    Make sure the metadata values are valid utf8 (can be nested)

    Raises ValueError if not valid utf8
    Úutf8zMetadata key zG is not valid utf8. Consider base64 encode for generic binary metadata.N)r<  rn   rð   rÏ  ÚUnicodeDecodeErrorró   rô   rb  )r;  rG  rH  s      rh   rb  rb  H  s~   € ð —‘Ó ò 
"‰ˆˆ1Ü�aœÔðØ—‘˜Õ ô ˜œ4Õ Ü˜qÕ!ñ
"øô &ò Ü Ø# A 3ð 'Jð Jóð ðús   ¨AÁA2c                  óf  — e Zd ZdZdddddœ	 	 	 	 	 	 	 	 	 dod„Zdddddœ	 	 	 	 	 	 	 	 	 dpd„Zd„ Zd„ Zd	„ Zdqd
„Z	d„ Z
	 	 	 	 drd„Zdsd„Zdtd„Zdud„Zdqd„Zdtd„Zdtd„Zdtd„Zdtd„Zddœ	 	 	 dvd„Zdtd„Zedwd„«       Zdxd„Zdyd„Zdzd{d„Zd|d}d„Zd~d„Zdd„Zd€d�d „Zdd!œd‚d"„Zddddd#d$œ	 	 	 	 	 	 	 	 	 	 	 dƒd%„Z ddddd#d$œ	 	 	 	 	 	 	 	 	 	 	 	 	 d„d&„Z!d…d'„Z"d…d(„Z#dzd†d)„Z$ e%d*¬+«      f	 	 	 	 	 d‡d,„Z&dˆd-„Z'dwd.„Z(d‰d/„Z)d‰d0„Z*d1dddddd2œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dŠd3„Z+d‹d4„Z,e-	 	 	 	 	 dŒ	 	 	 	 	 	 	 	 	 	 	 d�d5„«       Z.e-	 	 	 	 dŽ	 	 	 	 	 	 	 	 	 	 	 d�d6„«       Z.e-	 	 	 	 dŽ	 	 	 	 	 	 	 	 	 	 	 d�d7„«       Z.e-	 	 	 	 dŽ	 	 	 	 	 	 	 	 	 	 	 d‘d8„«       Z.e-	 	 	 	 dŽ	 	 	 	 	 	 	 	 	 	 	 d’d9„«       Z.e-	 	 	 	 dŽ	 	 	 	 	 	 	 	 	 	 	 d“d:„«       Z.	 	 	 	 	 dŒ	 	 	 	 	 	 	 	 	 	 	 d”d;„Z.	 	 	 	 d•d<„Z/	 	 	 	 d–d=„Z0ddd>œ	 	 	 	 	 	 	 d—d?„Z1d˜d@„Z2dAdBœ	 	 	 	 	 d™dC„Z3dšdD„Z4	 	 	 	 	 	 	 	 	 	 d›dE„Z5dœdF„Z6	 dzdddGœ	 	 	 	 	 	 	 d�dH„Z7	 dzddddIœ	 	 	 	 	 	 	 	 	 dždJ„Z8dŸdK„Z9	 	 	 d 	 	 	 	 	 	 	 d¡dL„Z:	 	 	 	 d¢dM„Z;	 	 	 	 d£dN„Z<	 	 	 	 d¤dO„Z=d¥dP„Z>d¦dQ„Z?dR„ Z@d§dS„ZAdT„ ZBdzd¨dU„ZCddVœ	 	 	 	 	 d©dW„ZDddVœ	 	 	 	 	 dªdX„ZEd«dY„ZF	 	 	 	 	 	 d¬dZ„ZG	 	 	 	 	 	 d­d[„ZH	 	 	 	 	 	 d®d\„ZI	 	 	 	 d¯d]„ZJ	 	 	 	 d°d^„ZKed±d_„«       ZLed²d`„«       ZMd³da„ZNdddddbœ	 	 	 	 	 	 	 d´dc„ZO	 dz	 	 	 	 	 	 	 dµdd„ZPd¶de„ZQdddfœ	 	 	 	 	 	 	 d·dg„ZRd¸dh„ZSdqdi„ZTdj„ ZU eVj®                  dkeXdl¬m«      	 	 	 	 d¹dn„«       ZYy)ºr  a8
  
    An AsyncTable is a collection of Records in a LanceDB Database.

    An AsyncTable can be obtained from the
    [AsyncConnection.create_table][lancedb.AsyncConnection.create_table] and
    [AsyncConnection.open_table][lancedb.AsyncConnection.open_table] methods.

    An AsyncTable object is expected to be long lived and reused for multiple
    operations. AsyncTable objects will cache a certain amount of index data in memory.
    This cache will be freed when the Table is garbage collected.  To eagerly free the
    cache you can call the [close][lancedb.AsyncTable.close] method.  Once the
    AsyncTable is closed, it cannot be used for any further operations.

    An AsyncTable can also be used as a context manager, and will automatically close
    when the context is exited.  Closing a table is optional.  If you do not close the
    table, it will be closed when the AsyncTable object is garbage collected.

    Examples
    --------

    Create using [AsyncConnection.create_table][lancedb.AsyncConnection.create_table]
    (more examples in that method's documentation).

    >>> import lancedb
    >>> async def create_a_table():
    ...     db = await lancedb.connect_async("./.lancedb")
    ...     data = [{"vector": [1.1, 1.2], "b": 2}]
    ...     table = await db.create_table("my_table", data=data)
    ...     print(await table.query().limit(5).to_arrow())
    >>> import asyncio
    >>> asyncio.run(create_a_table())
    pyarrow.Table
    vector: fixed_size_list<item: float>[2]
      child 0, item: float
    b: int64
    ----
    vector: [[[1.1,1.2]]]
    b: [[2]]

    Can append new data with [AsyncTable.add()][lancedb.table.AsyncTable.add].

    >>> async def add_to_table():
    ...     db = await lancedb.connect_async("./.lancedb")
    ...     table = await db.open_table("my_table")
    ...     await table.add([{"vector": [0.5, 1.3], "b": 4}])
    >>> asyncio.run(add_to_table())

    Can query the table with
    [AsyncTable.vector_search][lancedb.table.AsyncTable.vector_search].

    >>> async def search_table_for_vector():
    ...     db = await lancedb.connect_async("./.lancedb")
    ...     table = await db.open_table("my_table")
    ...     results = (
    ...       await table.vector_search([0.4, 0.4]).select(["b", "vector"]).to_pandas()
    ...     )
    ...     print(results)
    >>> asyncio.run(search_table_for_vector())
       b      vector  _distance
    0  4  [0.5, 1.3]       0.82
    1  2  [1.1, 1.2]       1.13

    Search queries are much faster when an index is created. See
    [AsyncTable.create_index][lancedb.table.AsyncTable.create_index].
    NF)r  rf   rg   r  c               ój   — || _         |xs g | _        || _        |xs
 t        «       | _        || _        y)a  Create a new AsyncTable object.

        You should not create AsyncTable objects directly.

        Use [AsyncConnection.create_table][lancedb.AsyncConnection.create_table] and
        [AsyncConnection.open_table][lancedb.AsyncConnection.open_table] to obtain
        Table objects.N)rŸ  r  r  r  r  r  )rH  r!  r  rf   rg   r  s         rh   r  zAsyncTable.__init__ž  s9   € ð  ˆŒØ-Ò3°ˆÔØ!1ˆÔØ$7Ò$@¼3»5ˆÔ!ð (>ˆÕ$rj   c               ó^   — |xs g | _         || _        |xs
 t        «       | _        || _        | S r¨   )r  r  r  r  r  )rH  r  rf   rg   r  s        rh   Ú_set_namespace_contextz!AsyncTable._set_namespace_context¶  s5   € ð  .Ò3°ˆÔØ!1ˆÔØ$7Ò$@¼3»5ˆÔ!Ø'=ˆÔ$Øˆrj   c                ó6   — | j                   j                  «       S r¨   )rŸ  rR  rG  s    rh   rR  zAsyncTable.__repr__Ä  s   € Ø�{‰{×#Ñ#Ó%Ð%rj   c                ó   — | S r¨   re   rG  s    rh   Ú	__enter__zAsyncTable.__enter__Ç  s   € Øˆrj   c                ó$   — | j                  «        y r¨   )rˆ  )rH  r¶  s     rh   Ú__exit__zAsyncTable.__exit__Ê  s   € Ø�
‰
�rj   c                ó6   — | j                   j                  «       S )z!Return True if the table is open.)rŸ  Úis_openrG  s    rh   rp  zAsyncTable.is_openÍ  s   € à�{‰{×"Ñ"Ó$Ð$rj   c                ó6   — | j                   j                  «       S )zÆClose the table and free any resources associated with it.

        It is safe to call this method multiple times.

        Any attempt to use the table after it has been closed will raise an error.)rŸ  rˆ  rG  s    rh   rˆ  zAsyncTable.closeÑ  s   € ð �{‰{× Ñ Ó"Ð"rj   c              ƒ  ó”   K  — t        |t        «      r|g}nt        |«      }| j                  j	                  |«      ƒ d{  –—†  y7 Œ­w)aÂ  Set the unenforced primary key for this table to the given
        ordered list of columns.

        "Unenforced" means LanceDB does not check uniqueness on writes; the
        columns are recorded in the schema as the primary key so that
        features such as `merge_insert` can use them. Calling this again
        replaces any previously-set primary key.

        Parameters
        ----------
        columns : str or Iterable[str]
            Either a single column name (single-column key) or an ordered
            iterable of column names (composite key). Each column dtype
            must be one of: int32, int64, utf8, large_utf8, binary,
            large_binary, fixed_size_binary.
        N)rn   ro   r
  rŸ  rÅ  rx  s     rh   rÅ  z%AsyncTable.set_unenforced_primary_keyÙ  s:   è ø€ ô& �gœsÔ#Ø�i‰Gä˜7“mˆGØ�k‰k×4Ñ4°WÓ=×=Ò=ús   ‚>AÁ AÁAc              ƒ  óV   K  — | j                   j                  |«      ƒ d{  –—†  y7 Œ­w)u¶  Install an RTEWriteSpec on this table.

        The spec selects Lance's MemWAL LSM-style write path for future
        `merge_insert` calls. ``RTEWriteSpec`` chooses one of three sharding
        strategies:

        - ``RTEWriteSpec.bucket(column, num_buckets)`` â€” hash-bucket writes by
          the single-column unenforced primary key.
        - ``RTEWriteSpec.identity(column)`` â€” shard by the raw value of a
          scalar column.
        - ``RTEWriteSpec.unsharded()`` â€” route every write to a single shard.

        All variants require the table to have an unenforced primary key set
        via [`set_unenforced_primary_key`]; bucket sharding additionally
        requires it to be the single column being bucketed.

        By default the RTE maintains every index on the table, re-read as the
        table changes, so an index created later is maintained too; one of a
        kind the RTE cannot mirror is skipped. Name the set with
        ``with_maintained_indexes`` to pin it instead: each name must already
        exist and be maintainable (a still-building index is rejected, not
        omitted); ``[]`` maintains none.

        Parameters
        ----------
        spec : RTEWriteSpec
            The sharding spec to install.

        Examples
        --------
        >>> from lancedb import RTEWriteSpec
        >>> # table.set_unenforced_primary_key("id")
        >>> # table.enable_rte(RTEWriteSpec.bucket("id", 16))
        N)rŸ  rÇ  rÈ  s     rh   rÇ  zAsyncTable.enable_rteò  s!   è ø€ ðF �k‰k×$Ñ$ TÓ*×*Ò*úó   ‚)¡'¢)c              ƒ  óT   K  — | j                   j                  «       ƒ d{  –—†  y7 Œ­w)z™Remove the RTEWriteSpec from this table.

        Reverts to the standard `merge_insert` write path. Errors if no spec
        is currently set.
        N)rŸ  rË  rG  s    rh   rË  zAsyncTable.disable_rte  s   è ø€ ð �k‰k×%Ñ%Ó'×'Ò'úó   ‚( &¡(c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)u„  Read the RTEWriteSpec currently installed on this table.

        Returns ``None`` when the RTE write path is not enabled at all â€” no
        spec has been set, or one was removed with `disable_rte`.
        That is a different answer from a spec whose ``maintained_indexes``
        is ``None``, which is an installed spec selecting indexes
        automatically.

        The spec read back is the one that was installed, selection
        included: ``None`` maintains every supported index the table has now
        or gains later, ``[]`` maintains none, and a non-empty list maintains
        exactly those. All three round-trip.
        N)rŸ  rÎ  rG  s    rh   rÎ  zAsyncTable.get_rte_spec  s!   è ø€ ð —[‘[×-Ñ-Ó/×/Ð/Ð/úó   ‚' %¡'c                ó6   — | j                   j                  «       S )z=See [`Table._hybrid_pk_fusion_learned`][lancedb.table.Table].)rŸ  Úhybrid_pk_fusion_learnedrG  s    rh   rŸ  z$AsyncTable._hybrid_pk_fusion_learned0  s   € à�{‰{×3Ñ3Ó5Ð5rj   c                ó8   — | j                   j                  «        y)z:See [`Table._note_hybrid_pk_fusion`][lancedb.table.Table].N)rŸ  Únote_hybrid_pk_fusionrG  s    rh   r¡  z!AsyncTable._note_hybrid_pk_fusion4  s   € à�‰×)Ñ)Õ+rj   c              ƒ  óT   K  — | j                   j                  «       ƒ d{  –—†  y7 Œ­w)a  Converge this table's RTE write path into its base table.

        One flush, freezing every memtable into an SSTable, then compaction triggers
        until every SSTable that existed at that moment has reached base.
        The loop runs client-side, reading progress from ``get_rte_stats``.

        Best-effort: SSTables created *while* it runs are deliberately not
        waited on, which is what lets it terminate on a table taking writes.
        Idempotent and safe on a cadence.

        There is no deadline, and the caller owns that. It returns when the
        target SSTables are gone, raises on a terminal server fault, and
        otherwise waits however long the server takes. A slow table and a
        stuck one are the same picture from the client: the compactor pool is
        shared across every table on the node, so a checkpoint queued behind
        unrelated work looks exactly like one that is merging. Wrap this in
        ``asyncio.wait_for`` for a wall-clock bound; abandoning it partway
        costs nothing.
        N)rŸ  rÐ  rG  s    rh   rÐ  zAsyncTable.checkpoint_rte8  s   è ø€ ð( �k‰k×(Ñ(Ó*×*Ò*úrv  c              ƒ  óT   K  — | j                   j                  «       ƒ d{  –—†  y7 Œ­w)u  Freeze every table shard's active memtable into an SSTable.

        Does not touch the base table â€” compacting SSTables into base is
        `compact_rte`. On a node that has not claimed this table, this claims
        it and replays its WAL log first.
        N)rŸ  rÒ  rG  s    rh   rÒ  zAsyncTable.flush_rteN  s   è ø€ ð �k‰k×#Ñ#Ó%×%Ò%úrv  c              ƒ  óT   K  — | j                   j                  «       ƒ d{  –—†  y7 Œ­w)a  Trigger a background SSTable compaction pass per table shard.

        Returns once the passes are dispatched, not once they finish: watch
        ``get_rte_stats`` for progress, or use ``checkpoint_rte`` to loop
        until the current SSTables have reached base.
        N)rŸ  rÔ  rG  s    rh   rÔ  zAsyncTable.compact_rteW  s   è ø€ ð �k‰k×%Ñ%Ó'×'Ò'úrv  rÕ  c             ƒ  óT   K  — | j                   j                  |«      ƒ d{  –—† S 7 Œ­w)a‰  Read live per-table-shard RTE state.

        Answers "how far behind is my fresh tier", "which table shard is hot", and
        "why is my fresh-tier vector search brute-force". Mutates no table
        state, though on a node that has not claimed this table it claims it,
        exactly as a read would.

        Returns ``None`` only when the RTE write path is not enabled.

        Parameters
        ----------
        include_sstable_rows
            Report a row count per SSTable. Off by default: each count
            opens an uncached Lance dataset, and ``checkpoint_rte`` polls this
            needing only generation numbers.
        N)rŸ  rØ  rÙ  s     rh   rØ  zAsyncTable.get_rte_stats`  s$   è ø€ ð& —[‘[×.Ñ.Ð/CÓD×DÐDÐDúó   ‚(¡&¢(c              ƒ  óT   K  — | j                   j                  «       ƒ d{  –—†  y7 Œ­w)a_  Drain and close any cached RTE shard writers for this table.

        When an RTE write spec is installed, `merge_insert` opens RTE shard
        writers and caches them for reuse across calls. This closes them,
        flushing pending data; writers reopen lazily on the next
        `merge_insert`. It is a no-op when no writers are cached.
        N)rŸ  rÛ  rG  s    rh   rÛ  zAsyncTable.close_rte_writersu  s   è ø€ ð �k‰k×+Ñ+Ó-×-Ò-úrv  c                ó6   — | j                   j                  «       S )zThe name of the table.)rŸ  rù   rG  s    rh   rù   zAsyncTable.name  s   € ð �{‰{×ÑÓ!Ð!rj   c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)rQ  N)rŸ  r  rG  s    rh   r  zAsyncTable.schema„  s!   è ø€ ð
 —[‘[×'Ñ'Ó)×)Ð)Ð)úrx  c              ƒ  ó˜   K  — | j                  «       ƒ d{  –—† }t        j                  «       j                  |j                  «      S 7 Œ1­w)r�  N)r  r6   r,  r-  r;  )rH  r  s     rh   r^  zAsyncTable.embedding_functions‹  s9   è ø€ ð —{‘{“}×$ˆÜ(×5Ñ5Ó7×GÑGÈÏÉÓXÐXð %ús   ‚A
–A—2A
c              ƒ  óT   K  — | j                   j                  |«      ƒ d{  –—† S 7 Œ­w)ra  N)rŸ  r[  rb  s     rh   r[  zAsyncTable.count_rows˜  s#   è ø€ ð —[‘[×+Ñ+¨FÓ3×3Ð3Ð3úr�  c              ƒ  óx   K  — | j                  «       j                  |«      j                  «       ƒ d{  –—† S 7 Œ­w)z¤
        Return the first `n` rows of the table.

        Parameters
        ----------
        n: int, default 5
            The number of rows to return.
        N)r4  rb  rA  rW  s     rh   rV  zAsyncTable.head£  s.   è ø€ ð —Z‘Z“\×'Ñ'¨Ó*×3Ñ3Ó5×5Ð5Ð5ús   ‚1:³8´:c                óJ   — t        | j                  j                  «       | «      S )a]  
        Returns an [AsyncQuery][lancedb.query.AsyncQuery] that can be used
        to search the table.

        Use methods on the returned query to control query behavior.  The query
        can be executed with methods like [to_arrow][lancedb.query.AsyncQuery.to_arrow],
        [to_pandas][lancedb.query.AsyncQuery.to_pandas] and more.
        )rL   rŸ  r4  rG  s    rh   r4  zAsyncTable.query®  s   € ô ˜$Ÿ+™+×+Ñ+Ó-¨tÓ4Ð4rj   c              ‹  ó¨  K  — | j                   j                  «       st        d«      ‚	 ddl}| j                  «       }| j                  «       ƒ d{  –—† }|�dn|} |j                  | j                  «       ƒ d{  –—† f|| j                  «       ƒ d{  –—† dœ|¤Ž}|�|j                  ||f«      }|S # t        $ r t	        d«      ‚w xY w7 Œ{7 ŒS7 Œ<­w)aw  Return the Lance dataset backing a local table.

        Remote tables cannot be opened as Lance datasets by the client. Use
        [to_arrow][lancedb.table.AsyncTable.to_arrow] or
        [query][lancedb.table.AsyncTable.query] to read them through the server.

        Parameters
        ----------
        **kwargs
            Forwarded to `lance.dataset`.

        Returns
        -------
        lance.LanceDataset
            The Lance dataset at this table handle's version and branch.

        Examples
        --------
        >>> async def get_lance_dataset(table):
        ...     return await table.to_lance()
        zGto_lance() is not supported for remote tables; query the server insteadr   Nr/  r1  )rŸ  Ú
_is_nativerF  r/   rs   rY  rO  r?  rì   r  r2  )rH  rh  r/   r3  Útable_versionrO  r5  s          rh   rn  zAsyncTable.to_lance¹  sí   è ø€ ð, �{‰{×%Ñ%Ô'Ü%ð+óð ð
	Ûð ×$Ñ$Ó&ˆØ"Ÿl™l›n×,ˆØ Ð,‘$°-ˆØˆU�]‰]Ø—(‘(“*×ð
àØ"&×"=Ñ"=Ó"?×?ñ
ð ñ	
ˆð ÐØ×$Ñ$ f¨mÐ%<Ó=ˆBØˆ	øô' ò 	Üð=óð ð	úð -øð øà?úsK   ‚&C©B4 ­#CÁCÁ)CÁ:CÁ;CÂCÂ CÂ4C	Ã	CÃCÃCrd  c              ‹  ó
  K  — t        |«       | j                  «       ƒ d{  –—† }|dk(  st        |«      sD| j                  «       ƒ d{  –—† }|dk(  rt	        |t        |«      «      } |j                  di |¤ŽS | j                  j                  «       s* | j                  «       j                  dd|i|¤Žƒ d{  –—† S |dk(  rLt        | j                  «       ƒ d{  –—† «      dk(  r( | j                  «       ƒ d{  –—† j                  di |¤ŽS |dk(  r5t        |«      r* | j                  «       j                  dd|i|¤Žƒ d{  –—† S  | j                  «       ƒ d{  –—† j                  dd|i|¤ŽS 7 �ŒR7 �Œ-7 Œ¿7 ŒŸ7 Œ�7 Œ:7 Œ#­w)a—  Return the table as a pandas DataFrame.

        Parameters
        ----------
        blob_mode: str, default "lazy"
            Controls how Lance blob columns are returned. Remote tables support
            "descriptions"; "bytes" and "lazy" are not yet supported.
        **kwargs
            Forwarded to PyArrow / Lance pandas conversion.

        Returns
        -------
        pd.DataFrame
        NrZ  rg  rd  r[  rð   re   )r$   r  rb   rA  r#   ra   rf  rŸ  rŠ  r4  rZ   rì   r_   rn  )rH  rg  rh  r  r\  s        rh   rf  zAsyncTable.to_pandasì  sY  è ø€ ô 	˜9Ô%Ø—{‘{“}×$ˆØ˜Ò&Ô.CÀFÔ.KØ"Ÿm™m›o×-ˆIØ˜NÒ*Ü.ØÔ<¸VÓDó�	ð '�9×&Ñ&Ñ0¨Ñ0Ð0à�{‰{×%Ñ%Ô'Ø/˜Ÿ™›×/Ñ/ÑN¸)ÐNÀvÑN×NÐNà˜Ò¤>¸¿¹»
×2BÓ#CÀxÒ#OØ4˜$Ÿ-™-›/×)×4Ñ4Ñ>°vÑ>Ð>Ø˜ÒÔ$8¸Ô$@Ø/˜Ÿ™›×/Ñ/ÑN¸)ÐNÀvÑN×NÐNØ0�d—m‘m“o×%×0Ñ0ÑO¸9ÐOÈÑOÐOð! %ùà-ùð Oøà2BøØ)øàNøØ%ús}   ‚F¡E3¢'FÁ	E6Á
A/FÂ9E9Â:!FÃE;ÃFÃ;E=Ã<AFÅE?ÅFÅFÅFÅ6FÅ9FÅ;FÅ=FÅ?FÆFri  c             ƒ  óÂ  K  — t        |«       | j                  «       ƒ d{  –—† }|dk(  xr t        |«      }|swt        | j                  | j
                  «      rW| j                  sK| j                  t        «       «      ƒ d{  –—† j                  «       }|dk(  rt        |t        |«      «      }|S | j                  «       j                  |¬«      ƒ d{  –—† S 7 Œ·7 ŒX7 Œ­w)rk  Nrð   rZ  ri  )r$   r  rb   ri   r  r  r  r  rW   rL  r#   ra   r4  rA  )rH  rg  r  Úfetches_bytesr  s        rh   rA  zAsyncTable.to_arrow  sÆ   è ø€ ô 	˜9Ô%Ø—{‘{“}×$ˆØ! WÑ,ÒNÔ1FÀvÓ1NˆáÜ-Ø×&Ñ&¨×(AÑ(Aôð ×0Ò0à×,Ñ,¬U«WÓ5×5×?Ñ?ÓAˆCØ˜NÒ*Ü(¨Ô.KÈFÓ.SÓT�ØˆJà—Z‘Z“\×*Ñ*°YÐ*Ó?×?Ð?ð %øð 6øð
 @ús5   ‚C¡C¢A CÂCÂACÃCÃCÃCÃCTrh  c             ƒ  óÎ  K  — |�ht        |t        t        t        t        t
        t        t        t        t        t        t        t        f«      s t        dt        t        |«      «      z   «      ‚	 | j                   j#                  ||||||¬«      ƒ d{  –—†  y7 Œ# t$        t&        f$ r9}t        |t        «      r"t)        ||j*                  |j,                  ¬«       |‚d}~ww xY w­w)a  Create an index to speed up queries

        Indices can be created on vector columns or scalar columns.
        Indices on vector columns will speed up vector searches.
        Indices on scalar columns will speed up filtering (in both
        vector and non-vector searches)

        Parameters
        ----------
        column: str
            The column to index.
        replace: bool, default True
            Whether to replace the existing index

            If this is false, and another index already exists on the same columns
            and the same name, then an error will be returned.  This is true even if
            that index is out of date.

            The default is True
        config: default None
            For advanced configuration you can specify the type of index you would
            like to create.   You can also specify index-specific parameters when
            creating an index object.
        wait_timeout: timedelta, optional
            The timeout to wait if indexing is asynchronous.
        name: str, optional
            The name of the index. If not provided, a default name will be generated.
        train: bool, default True
            Whether to train the index with existing data. Vector indices always train
            with existing data.
        Nzqconfig must be an instance of IvfSq, IvfPq, IvfRq, HnswPq, HnswSq, BTree, Bitmap, LabelList, Fm, or FTS, but got ©rì  r§  r¨  rù   r©  r„  )rn   r8   r:   r9   r<   r?   r@   rA   r7   r;   r=   r>   rB   rú   ro   rû   rŸ  r¬  ró   rt   r®   r    r¥   )rH  r$  r§  rw  r¨  rù   r©  r*  s           rh   r¬  zAsyncTable.create_index.  sã   è ø€ ðn ÐÜØäÜÜÜÜÜÜÜÜÜÜÜðôô"  ðFäœ$˜v›,Ó'ñ(óð ð
	Ø—+‘+×*Ñ*ØØØØ)ØØð +ó ÷ ò ùô œLÐ)ò 	Ü˜&¤#Ô&Ü)ØØ#)×#8Ñ#8Ø#Ÿ_™_õð
 ˆGûð	üs<   ‚A+C%Á.$B ÂBÂB ÂC%ÂB ÂC"Â)4CÃC"Ã"C%c             ƒ  óv   K  — | j                   j                  ||||||¬«      ƒ d{  –—† }t        |«      S 7 Œ­w)a
  Create an index, returning a handle to the indexing job.

        Takes the same arguments as :meth:`create_index`. The job may already
        be complete when returned; callers must not assume the index exists
        until :meth:`AsyncJob.wait` resolves.
        r�  N)rŸ  r»  r)   )rH  r$  r§  rw  r¨  rù   r©  Újobs           rh   r»  zAsyncTable.create_index_asyncŽ  sI   è ø€ ð< —K‘K×2Ñ2ØØØØ%ØØð 3ó 
÷ 
ˆô ˜‹}Ðð
ús   ‚%9§7¨9c              ƒ  óV   K  — | j                   j                  |«      ƒ d{  –—†  y7 Œ­w)aã  
        Drop an index from the table.

        Parameters
        ----------
        name: str
            The name of the index to drop.

        Notes
        -----
        This does not delete the index from disk, it just removes it from the table.
        To delete the index, run [optimize][lancedb.table.AsyncTable.optimize]
        after dropping the index.

        Use [list_indices][lancedb.table.AsyncTable.list_indices] to find the names
        of the indices.
        N)rŸ  r¾  r½  s     rh   r¾  zAsyncTable.drop_index¶  s    è ø€ ð$ �k‰k×$Ñ$ TÓ*×*Ò*úrt  c              ƒ  óV   K  — | j                   j                  |«      ƒ d{  –—†  y7 Œ­w)rr  N)rŸ  rs  r½  s     rh   rs  zAsyncTable.prewarm_indexÊ  s    è ø€ ð( �k‰k×'Ñ'¨Ó-×-Ò-úrt  c              ƒ  óV   K  — | j                   j                  |«      ƒ d{  –—†  y7 Œ­w)ru  N)rŸ  rv  rx  s     rh   rv  zAsyncTable.prewarm_dataà  s    è ø€ ð* �k‰k×&Ñ& wÓ/×/Ò/úrt  r¶  r¿  c              ƒ  óX   K  — | j                   j                  ||«      ƒ d{  –—†  y7 Œ­w)rÂ  N)rŸ  rÆ  rÃ  s      rh   rÆ  zAsyncTable.wait_for_index÷  s"   è ø€ ð �k‰k×(Ñ(¨°gÓ>×>Ò>úó   ‚ *¢(£*c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)rÈ  N)rŸ  rÉ  rG  s    rh   rÉ  zAsyncTable.stats  s!   è ø€ ð —[‘[×&Ñ&Ó(×(Ð(Ð(úrx  c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)a8  
        Get the table URI (storage location).

        For remote tables, this fetches the location from the server via describe.
        For local tables, this returns the dataset URI.

        Returns
        -------
        str
            The full storage location of the table (e.g., S3/GCS path).
        N)rŸ  rì   rG  s    rh   rì   zAsyncTable.uri  s   è ø€ ð —[‘[—_‘_Ó&×&Ð&Ð&úrx  c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)r{  N)rŸ  r|  rG  s    rh   r|  z"AsyncTable.initial_storage_options  s!   è ø€ ð —[‘[×8Ñ8Ó:×:Ð:Ð:úrx  c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)r~  N)rŸ  r  rG  s    rh   r  z!AsyncTable.latest_storage_options+  s!   è ø€ ð —[‘[×7Ñ7Ó9×9Ð9Ð9úrx  r3  r‡  c          	   ƒ  óœ  K  — | j                  «       ƒ d{  –—† }t        ||«      }t        ||«      }	|	�|	}|€d}|€d}|dk(  rWt        j                  t
        |d||¬«      ƒ d{  –—† \  }}
t        |«      rtt        |j                   |«      }t        ||«      }nQ|dk7  s|j                  �@d|j                  v r2t        j                  t        |||j                  ||d¬«      ƒ d{  –—† }t        «        t        j                  t        |«      ƒ d{  –—† }t        |«      \  }}	 | j                  j                  ||xs d	|||¬
«      ƒ d{  –—† |r|j!                  «        S S 7 �ŒP7 �Œ7 Œ„7 ŒZ7 Œ!# t"        $ r6}dt%        |«      v rt'        |«      ‚dt%        |«      v rt'        |«      ‚‚ d}~ww xY w# |r|j!                  «        w w xY w­w)a  Add more data to the [AsyncTable][lancedb.table.AsyncTable].

        Parameters
        ----------
        data: DATA
            The data to insert into the table. Acceptable types are:

            - list-of-dict

            - pandas.DataFrame

            - pyarrow.Table or pyarrow.RecordBatch
        mode: str
            The mode to use when writing the data. Valid values are
            "append" and "overwrite". Overwrite adopts explicitly declared blob
            layouts, while inferred bytes retain the existing blob v2 fields.
        on_bad_vectors: str, default "error"
            How to handle vectors with incorrect sizes, NaNs, or null elements.
            One of "error", "drop", "fill", "null".
        fill_value: float, default 0.
            The value to use when filling vectors. Only used if on_bad_vectors="fill".
        progress: callable or tqdm-like, optional
            A callback or tqdm-compatible progress bar. See
            :meth:`Table.add` for details.
        write_parallelism: int, optional
            Number of partitions to write in parallel. Higher values increase
            throughput but also peak memory use, since each partition buffers
            data in flight. Defaults to an estimate based on the data size,
            capped at the number of CPU cores. Lower this if bulk ingestion is
            using too much memory.
        allow_external_blob_outside_bases: bool, default False
            Allow blob URIs outside registered bases. See :meth:`Table.add`.
            Local tables only.

        NrÈ  rÉ  Ú	overwrite)r[  r\  s   embedding_functionsT©r;  r[  r\  rX  r3  )rA  rÝ  rÞ  z
Cast errorzVector column contains NaN)r  r9  r%  ÚasyncioÚ	to_threadr  r_   ry  rd  r;  rf  r   r   rB  rŸ  rß  rˆ  rt   ro   ró   )rH  rë   rÜ  r[  r\  rA  rÝ  rÞ  r  Ú
blob_tabler¶  r]  r‰  r*  s                 rh   rß  zAsyncTable.add;  sß  è ø€ ð\ —{‘{“}×$ˆÜ% d¨FÓ3ˆÜ)¨$°Ó7ˆ
ØÐ!ØˆDØÐ!Ø$ˆNØÐØˆJð �;Òô $×-Ñ-Ü%ØØØ-Ø%ô÷ ‰GˆD�!ô $ FÔ+ô !9¸¿¹ÀfÓ M�Ü-¨d°MÓB‘Ø˜wÒ&Ø�O‰OÐ'Ð,BÀfÇoÁoÑ,Uä ×*Ñ*ÜØØØŸ™Ø-Ø%Ø $ô÷ ˆDô 	&Ô'ô ×&Ñ&¤|°TÓ:×:ˆÜ,¨XÓ6‰ˆ�$ð	!ØŸ™Ÿ™ØØÒ ˜Ø!Ø"3Ø2Sð )ó ÷ ñ Ø—‘Õ ð ð{ %ùðùðøð ;øðùô ò 	Øœs 1›vÑ%Ü  “mÐ#Ø-´°Q³Ñ7Ü  “mÐ#àûð	ûñ Ø—‘Õ ð üs‰   ‚G–E&—AGÁ%E)Á&BGÃ'E,Ã(+GÄE.ÄGÄ''E2 ÅE0ÅE2 ÅGÅ)GÅ,GÅ.GÅ0E2 Å2	F1Å;1F,Æ,F1Æ1F4 Æ4G	Ç	Gc                óh   — t        |t        «      r|gnt        t        |«      «      }t	        | |«      S rá  râ  rã  s     rh   rå  zAsyncTable.merge_insert©  ræ  rj   c              ƒ  ó   K  — y ­wr¨   re   ©rH  r4  rz  ré  rê  rë  s         rh   rí  zAsyncTable.searché  s   è ø€ ð ùó   ‚c              ƒ  ó   K  — y ­wr¨   re   r¤  s         rh   rí  zAsyncTable.searchó  s   è ø€ ð DGùr¥  c              ƒ  ó   K  — y ­wr¨   re   r¤  s         rh   rí  zAsyncTable.searchý  ó   è ø€ ð ùr¥  c              ƒ  ó   K  — y ­wr¨   re   r¤  s         rh   rí  zAsyncTable.search  r¨  r¥  c              ƒ  ó   K  — y ­wr¨   re   r¤  s         rh   rí  zAsyncTable.search  s   è ø€ ð ùr¥  c              ƒ  ó   K  — y ­wr¨   re   r¤  s         rh   rí  zAsyncTable.search  r¨  r¥  c              ƒ  óŠ  ‡ ‡K  — |€‰ j                  «       S d„ }	 	 	 	 	 	 	 	 dˆ fd„}d„ }|dk(  rŸ ||«      r|}	d}�nt        |t        «      rd}nót        |t        «      rk	 t	        j
                  ‰ j                  «        ||d|«      «      ƒ d{  –—† \  }
\  }Š‰�+ |‰|«      ƒ d{  –—† }	t        ˆfd„|
D «       «      rd	}n~d}n{d}nxd}nu|dk(  r2 ||«      r|}	ne ||||«      ƒ d{  –—† \  }Š |‰|«      ƒ d{  –—† }	n>|d	k(  r9 ||«      rt        d«      ‚ ||||«      ƒ d{  –—† \  }Š |‰|«      ƒ d{  –—† }	|dk(  r4‰ j                  «       j                  	«      }|r|j                  |«      }|S |dk(  r!‰ j                  «       j                  ||¬«      S |d	k(  rE‰ j                  «       j                  	«      }|r|j                  |«      }|j                  ||¬«      S t        d|› d�«      ‚7 �Œk7 �ŒU# t        $ r)}d
t        |«      v rdt        |«      v rd}n|‚Y d}~Œëd}~ww xY w7 �ŒK7 �Œ:7 �Œ7 �Œ­w)aò  Create a search query to find the nearest neighbors
        of the given query vector. We currently support [vector search](https://lancedb.com/docs/search/vector-search/)
        and [full-text search](https://lancedb.com/docs/search/full-text-search/).

        All query options are defined in [AsyncQuery][lancedb.query.AsyncQuery].

        Parameters
        ----------
        query: list/np.ndarray/str/PIL.Image.Image, default None
            The targeted vector to search for.

            - *default None*.
            Acceptable types are: list, np.ndarray, PIL.Image.Image

            - If None then a plain [AsyncQuery][lancedb.query.AsyncQuery] is
            returned, equivalent to calling [query][lancedb.table.AsyncTable.query].
            The select/where/limit clauses are applied to filter the table.
        vector_column_name: str, optional
            The name of the vector column to search.

            The vector column needs to be a pyarrow fixed size list type

            - If not specified then the vector column is inferred from
            the table schema

            - If the table has multiple vector columns then the *vector_column_name*
            needs to be specified. Otherwise, an error is raised.
        query_type: str
            *default "auto"*.
            Acceptable types are: "vector", "fts", "hybrid", or "auto"

            - If "auto" then the query type is inferred from the query;

                - If `query` is a list/np.ndarray then the query type is
                "vector";

                - If `query` is a PIL.Image.Image then either do vector search,
                or raise an error if no corresponding embedding function is found.

            - If `query` is a string, then the query type is "vector" if the
              table has embedding functions else the query type is "fts"

        Returns
        -------
        AsyncQuery, AsyncHybridQuery, AsyncFTSQuery, or AsyncVectorQuery
            A query builder object representing the query.
        Nc                ó~   — t        | t        t        j                  t        j
                  t        j                  f«      S r¨   )rn   r
  r  Úndarrayr  ÚArrayr+  r3  s    rh   Úis_embeddingz'AsyncTable.search.<locals>.is_embeddingb  s$   € Ü˜e¤d¬B¯J©J¼¿¹Ä"Ç/Á/Ð%RÓSÐSrj   c              “  ó°  •K  — t        |t        «      rd}‰j                  «       ƒ d {  –—† }t        |||| ¬«      } t	        j
                  «       j                  |j                  «      }|j                  | «      }|€St        d| › d�«      }t        |«      dkD  r(t        |dt        |j                  «       «      › �«       |‚t        |d«       |‚| |fS 7 Œª­w)NrŒ  r•  zColumn 'z'' has no registered embedding function.r   z0Embedding functions are registered for columns: z6No embedding functions are registered for any columns.)rn   rP   r  r[   r6   r,  r-  r;  r  ró   rq  rX   r
  rõ   )rz  ré  r4  r  Úfuncsr'  rÈ  rH  s          €rh   Úget_embedding_funcz-AsyncTable.search.<locals>.get_embedding_funce  sñ   øè ø€ ô
 ˜%¤Ô/Ø"�
ØŸ;™;›=×(ˆFÜ!9ØØ%ØØ#5ô	"Ðô .×:Ñ:Ó<×LÑLØ—‘óˆEð —9‘9Ð/Ó0ˆDØˆ|Ü"ØÐ1Ð2ð 3*ð *ó�ô �u“: ’>ÜØØJÜ §
¡
£Ó-Ð.ð0ôð �ô ØÐWôð �Ø% tÐ+Ð+ð7 )ús   ƒ&C©CªB+Cc              “  ó°   K  — | �Nt        j                  «       }|j                  t        «       | j                  j
                  |«      ƒ d {  –—† d   S y 7 Œ­w)Nr   )rŸ  Úget_running_loopÚrun_in_executorr(   r!  Ú#compute_query_embeddings_with_retry)r  r4  Úloops      rh   Úmake_embeddingz)AsyncTable.search.<locals>.make_embedding‰  s`   è ø€ ØÐ$Ü×/Ñ/Ó1�ð ×.Ñ.Ü*Ó,Ø!×*Ñ*×NÑNØó÷ ð
 ñð ð ðús   ‚A	AÁAÁ	ArÏ  rì  rŒ  c              3  óx   •K  — | ]1  }|j                   d    ‰j                  k(  xr |j                  dk(  –— Œ3 y­w)r   rB   N)r  r¤  rŽ  )rž   r  Úembedding_confs     €rh   r¡   z$AsyncTable.search.<locals>.<genexpr>·  sD   øè ø€ ò ð !"ð ŸI™I a™L¨N×,HÑ,HÑHò 6Ø !§¡°Ñ 5ó6ñùs   ƒ7:rð  ÚColumnz$has no registered embedding functionz#Hybrid search requires a text query)r  zUnknown query type: 'ú')rz  r¬  ré  rÁ   r4  rÑ  r£  z#Tuple[str, EmbeddingFunctionConfig])r4  rn   rP   ro   rŸ  ÚgatherrG  r¢   ró   Ú
nearest_tor$  Únearest_to_text)rH  r4  rz  ré  rê  rë  r°  r³  r¹  Úvector_queryrþ  r*  r:  r»  s   `            @rh   rí  zAsyncTable.search%  s³  ùè ø€ ðt ˆ=Ø—:‘:“<Ðò	Tð"	,Ø -ð"	,à!ð"	,ð Vð"	,ð 1õ	"	,òH	ð$ ˜Òá˜EÔ"Ø$�Ø%’
Ü˜E¤=Ô1Ø"‘
Ü˜E¤3Ô'ð+ô &Ÿn™nØ×)Ñ)Ó+Ù*Ð+=¸vÀuÓMó÷ ñØÙ<Ð+¨^ð &Ð1Ù-;¸NÈEÓ-R×'R˜Üó ð &-ôô ð
 *2™Jà)1™Jà%*™
ð &‘
Ø˜8Ò#Ù˜EÔ"Ø$‘á;MØ&¨
°Eó<÷ 6Ñ2Ð" Nñ &4°NÀEÓ%J×J‘Ø˜8Ò#Ù˜EÔ"Ü Ð!FÓGÐGá;MØ&¨
°Eó<÷ 6Ñ2Ð" Nñ &4°NÀEÓ%J×J�à˜Ò!Ø—j‘j“l×-Ñ-¨lÓ;ˆGÙ!Ø!Ÿ.™.Ð);Ó<�ØˆNØ˜5Ò Ø—:‘:“<×/Ñ/°¸{Ð/ÓKÐKØ˜8Ò#Ø—j‘j“l×-Ñ-¨lÓ;ˆGÙ!Ø!Ÿ.™.Ð);Ó<�Ø×*Ñ*¨5¸+Ð*ÓFÐFäÐ4°Z°LÀÐBÓCÐCðwùð (Súô "ò  Ø¤3Øó$ñ à@ÄCÈÃFÑJð &+™
à˜ô #ûð úð:6ùð  Kùð
6ùð  Kûs˜   „AIÁ"/H ÂG<Â
H ÂIÂ*G?Â+AIÃ,H7Ã-IÄ H:Ä*IÄ+H=Ä,IÄ?I Å B<IÇ<H Ç?IÈ	H4ÈH/È*IÈ/H4È4IÈ:IÈ=IÉ Ic                ó@   — | j                  «       j                  |«      S )a2  
        Search the table with a given query vector.
        This is a convenience method for preparing a vector query and
        is the same thing as calling `nearestTo` on the builder returned
        by `query`.  Seer [nearest_to][lancedb.query.AsyncQuery.nearest_to] for more
        details.
        )r4  r¿  )rH  Úquery_vectors     rh   Úvector_searchzAsyncTable.vector_searchä  s   € ð �z‰z‹|×&Ñ& |Ó4Ð4rj   c                ó0  — |j                   �‡| j                  |j                   «      }|j                  r|j                  |j                  «      }|j                  �|j                  |j                  «      }|j                  r|j	                  «       }|S | j                  «       }|j                  �|j                  |j                  «      }|j                  �|j                  |j                  «      }|j                  r|j                  |j                  «      }|j                  �|j                  |j                  «      }|j                  r|j                  «       }|j                  �|j                  |j                  «      }|j                  r|j	                  «       }|j                  r|j                  |j                  «      }|j                  �rá|j                  |j                  «      j                  |j                  |j                   «      }|j"                  �|j#                  |j"                  «      }|j$                  �|j%                  |j$                  «      }|j&                  �|j'                  |j&                  «      }|j(                  �A|j*                  �5|j)                  |j(                  «      j+                  |j*                  «      }nO|j(                  �|j)                  |j(                  «      }n'|j*                  �|j+                  |j*                  «      }|j,                  �|j-                  |j,                  «      }|j.                  r|j1                  |j.                  «      }|j2                  r|j3                  |j2                  «      }|j4                  r|j5                  «       }|j6                  r|j7                  «       }|j8                  r:|j;                  |j8                  j
                  |j8                  j                  «      }|S r¨   )rñ  r  rø  Úuse_rterï  r4  rb  r«  rc  r1  rì  Úorder_byrì  r¿  Údistance_rangeÚlower_boundÚupper_boundr  Únprobesr­  Úminimum_nprobesÚmaximum_nprobesÚrefine_factorr%  r$  ÚefÚbypass_vector_indexÚ
postfilterÚfull_text_queryrÀ  )rH  r4  Ú
take_queryÚasync_querys       rh   Ú_sync_query_to_asynczAsyncTable._sync_query_to_asyncñ  sM  € ð ×ÑÐ)Ø×*Ñ*¨5×+=Ñ+=Ó>ˆJØ�}Š}Ø'×.Ñ.¨u¯}©}Ó=�
Ø�}‰}Ð(Ø'×/Ñ/°·±Ó>�
Ø× Ò Ø'×3Ñ3Ó5�
ØÐà—j‘j“lˆØ�;‰;Ð"Ø%×+Ñ+¨E¯K©KÓ8ˆKØ�<‰<Ð#Ø%×,Ñ,¨U¯\©\Ó:ˆKØ�=Š=Ø%×,Ñ,¨U¯]©]Ó;ˆKØ�<‰<Ð#Ø%×+Ñ+¨E¯L©LÓ9ˆKØ×ÒØ%×1Ñ1Ó3ˆKØ�=‰=Ð$Ø%×-Ñ-¨e¯m©mÓ<ˆKØ×ÒØ%×1Ñ1Ó3ˆKØ�>Š>Ø%×.Ñ.¨u¯~©~Ó>ˆKà�<‹<Ø%×0Ñ0°·±Ó>×MÑMØ×!Ñ! 5×#4Ñ#4óˆKð ×"Ñ"Ð.Ø)×7Ñ7¸×8KÑ8KÓL�Ø�}‰}Ð(Ø)×1Ñ1°%·-±-Ó@�Ø×"Ñ"Ð.Ø)×7Ñ7¸×8KÑ8KÓL�Ø×$Ñ$Ð0°U×5JÑ5JÐ5VØ)×9Ñ9Ø×)Ñ)óç!‘/ %×"7Ñ"7Ó8ñ ð ×&Ñ&Ð2Ø)×9Ñ9¸%×:OÑ:OÓP‘Ø×&Ñ&Ð2Ø)×9Ñ9¸%×:OÑ:OÓP�Ø×"Ñ"Ð.Ø)×7Ñ7¸×8KÑ8KÓL�Ø×"Ò"Ø)×0Ñ0°×1DÑ1DÓE�Ø�xŠxØ)Ÿn™n¨U¯X©XÓ6�Ø×(Ò(Ø)×=Ñ=Ó?�à×ÒØ%×0Ñ0Ó2ˆKà× Ò Ø%×5Ñ5Ø×%Ñ%×+Ñ+¨U×-BÑ-B×-JÑ-JóˆKð Ðrj   r  c             ƒ  óV  K  — t        | j                  | j                  «      rX| j                  sL|j                  €@|j
                  €4ddlm} | j                  | j                  gz   } || j                  ||«      S | j                  |«      }|j                  ||¬«      ƒ d {  –—† S 7 Œ­w)Nr   r¦  )Úmax_batch_lengthrÅ  )ri   r  r  r  rñ  r­  r®  r§  r  rù   rÕ  rP  )rH  r4  rÓ   rÅ  r§  r0  rÔ  s          rh   r  zAsyncTable._execute_query;  s¬   è ø€ ô *Ø×&Ñ&¨×(AÑ(Aôð ×0Ò0Ø×"Ñ"Ð*Ø×#Ñ#Ð+åDà×+Ñ+¨t¯y©y¨kÑ9ˆHÙ-¨d×.DÑ.DÀhÐPUÓVÐVð ×/Ñ/°Ó6ˆà ×+Ñ+Ø'°ð ,ó 
÷ 
ð 	
ð 
ús   ‚B B)Â"B'Â#B)c              ƒ  ób   K  — | j                  |«      }|j                  |«      ƒ d {  –—† S 7 Œ­wr¨   )rÕ  Úexplain_plan)rH  r4  r   rÔ  s       rh   r!  zAsyncTable._explain_planY  s-   è ø€ à×/Ñ/°Ó6ˆØ ×-Ñ-¨gÓ6×6Ð6Ð6úó   ‚&/¨-©/r"  r#  c             ƒ  ób   K  — | j                  |«      }|j                  |«      ƒ d {  –—† S 7 Œ­wr¨   )rÕ  Úanalyze_plan)rH  r4  r$  rÔ  s       rh   r'  zAsyncTable._analyze_plan^  s0   è ø€ ð ×/Ñ/°Ó6ˆØ ×-Ñ-Ð.AÓB×BÐBÐBúrÚ  c              ƒ  ó`   K  — | j                  |«      }|j                  «       ƒ d {  –—† S 7 Œ­wr¨   )rÕ  r   )rH  r4  rÔ  s      rh   r*  zAsyncTable._output_schemah  s+   è ø€ Ø×/Ñ/°Ó6ˆØ ×.Ñ.Ó0×0Ð0Ð0ús   ‚%.§,¨.c              ƒ  óz  K  — | j                  «       ƒ d {  –—† }|€d}|€d}t        |||j                  ||d¬«      }t        |t        j
                  «      r8t        j                  j                  |j                   |j                  «       «      }| j                  j                  |t        |j                  |j                  |j                  |j                  |j                   |j"                  |j$                  |j&                  |j(                  |j*                  |j,                  ¬«      «      ƒ d {  –—† S 7 �Œ 7 Œ­w)NrÈ  rÉ  Trž  )rä  Úwhen_matched_update_allÚ!when_matched_update_all_conditionÚwhen_not_matched_insert_allÚ!when_not_matched_by_source_deleteÚ$when_not_matched_by_source_conditionÚ)when_not_matched_by_source_condition_exprrÅ  Ú	use_indexrÆ  Úvalidate_single_shard)r  rf  r;  rn   r  r°   r.  r/  rP  rŸ  Úexecute_merge_insertrô   Ú_onÚ_when_matched_update_allÚ"_when_matched_update_all_conditionÚ_when_not_matched_insert_allÚ"_when_not_matched_by_source_deleteÚ%_when_not_matched_by_source_conditionÚ*_when_not_matched_by_source_condition_exprÚ_timeoutÚ
_use_indexÚ_use_rteÚ_validate_single_shard)rH  r-  r.  r[  r\  r  rë   s          rh   r/  zAsyncTable._do_mergel  s  è ø€ ð —{‘{“}×$ˆØÐ!Ø$ˆNØÐØˆJÜØØØ—_‘_Ø)Ø!Ø ô
ˆô �dœBŸH™HÔ%Ü×'Ñ'×4Ñ4°T·[±[À$Ç/Á/ÓBSÓTˆDØ—[‘[×5Ñ5ØÜØ—9‘9Ø(-×(FÑ(FØ27×2ZÑ2ZØ,1×,NÑ,NØ27×2ZÑ2ZØ5:×5`Ñ5`Ø:?×:jÑ:jØŸ™Ø×*Ñ*ØŸ™Ø&+×&BÑ&Bôó
÷ 
ð 	
ð %ùð
ús"   ‚D;–D6—DD;Ä1D9Ä2D;Ä9D;c              ƒ  ó�   K  — t        |t        «      r|j                  n|}| j                  j                  |«      ƒ d{  –—† S 7 Œ­w)aF  Delete rows from the table.

        This can be used to delete a single row, many rows, all rows, or
        sometimes no rows (if your predicate matches nothing).

        Parameters
        ----------
        where: str or :class:`~lancedb.expr.Expr`
            The filter condition. Can be a SQL string or a type-safe
            :class:`~lancedb.expr.Expr` built with :func:`~lancedb.expr.col`
            and :func:`~lancedb.expr.lit`.

            The filter must not be empty, or it will error.

        Examples
        --------
        >>> import lancedb
        >>> data = [
        ...    {"x": 1, "vector": [1.0, 2]},
        ...    {"x": 2, "vector": [3.0, 4]},
        ...    {"x": 3, "vector": [5.0, 6]}
        ... ]
        >>> db = lancedb.connect("./.lancedb")
        >>> table = db.create_table("my_table", data)
        >>> table.to_pandas()
           x      vector
        0  1  [1.0, 2.0]
        1  2  [3.0, 4.0]
        2  3  [5.0, 6.0]
        >>> table.delete("x = 2")
        DeleteResult(num_deleted_rows=1, version=2)
        >>> table.to_pandas()
           x      vector
        0  1  [1.0, 2.0]
        1  3  [5.0, 6.0]

        If you have a list of values to delete, you can combine them into a
        stringified list and use the `IN` operator:

        >>> to_remove = [1, 5]
        >>> to_remove = ", ".join([str(v) for v in to_remove])
        >>> to_remove
        '1, 5'
        >>> table.delete(f"x IN ({to_remove})")
        DeleteResult(num_deleted_rows=1, version=3)
        >>> table.to_pandas()
           x      vector
        0  3  [5.0, 6.0]
        N)rn   rC   rŸ  r2  r   s      rh   r2  zAsyncTable.delete“  s8   è ø€ ôd %/¨u´dÔ$;�E—L’LÀˆ	Ø—[‘[×'Ñ'¨	Ó2×2Ð2Ð2ús   ‚=A¿AÁ Ar£  c             ƒ  ó>  K  — |�|�t        d«      ‚|€|€t        d«      ‚|�,|j                  «       D ��ci c]  \  }}|t        |«      “Œ }}}t        |t        «      r|j                  «       n|}| j                  j                  ||«      ƒ d{  –—† S c c}}w 7 Œ
­w)a|  
        This can be used to update zero to all rows in the table.

        If a filter is provided with `where` then only rows matching the
        filter will be updated.  Otherwise all rows will be updated.

        Parameters
        ----------
        updates: dict, optional
            The updates to apply.  The keys should be the name of the column to
            update.  The values should be the new values to assign.  This is
            required unless updates_sql is supplied.
        where: str or [Expr][lancedb.expr.Expr], optional
            The filter condition. Can be a SQL string or a type-safe
            [Expr][lancedb.expr.Expr] built with [col][lancedb.expr.col] and
            [lit][lancedb.expr.lit]. Only rows that satisfy this filter will
            be updated.
        updates_sql: dict, optional
            The updates to apply, expressed as SQL expression strings.  The keys should
            be column names. The values should be SQL expressions.  These can be SQL
            literals (e.g. "7" or "'foo'") or they can be expressions based on the
            previous value of the row (e.g. "x + 1" to increment the x column by 1)

        Returns
        -------
        UpdateResult
            An object containing:
            - rows_updated: The number of rows that were updated
            - version: The new version number of the table after the update

        Examples
        --------
        >>> import asyncio
        >>> import lancedb
        >>> from lancedb.expr import col
        >>> import pandas as pd
        >>> async def demo_update():
        ...     data = pd.DataFrame({"x": [1, 2], "vector": [[1, 2], [3, 4]]})
        ...     db = await lancedb.connect_async("./.lancedb")
        ...     table = await db.create_table("my_table", data)
        ...     # x is [1, 2], vector is [[1, 2], [3, 4]]
        ...     await table.update({"vector": [10, 10]}, where=col("x") == 2)
        ...     # x is [1, 2], vector is [[1, 2], [10, 10]]
        ...     await table.update(updates_sql={"x": "x + 1"})
        ...     # x is [2, 3], vector is [[1, 2], [10, 10]]
        >>> asyncio.run(demo_update())
        Nz2Only one of updates or updates_sql can be providedz.Either updates or updates_sql must be provided)ró   r<  r]   rn   rC   Úto_sqlrŸ  r7  )rH  rj  r1  r¤  rG  rH  r¡  s          rh   r7  zAsyncTable.updateÈ  sž   è ø€ ðl Ð ;Ð#:ÜÐQÓRÐRØˆ?˜{Ð2ÜÐMÓNÐNàÐØ:A¿-¹-»/×J±$°!°Q˜1œl¨1›oÑ-ÐJˆKÑJä&0°¼Ô&=�E—L‘L”NÀ5ˆ	Ø—[‘[×'Ñ'¨°YÓ?×?Ð?ùó Kð @ús   ‚4B¶BÁABÂBÂBrR  c          	   ƒ  ón  K  — |�t        |«      t        urt        d«      ‚|�3t        |«      t        usd|cxk  rdk  st        d«      ‚ t        d«      ‚|duxs |du}d}d}t	        |t
        «      r|}nŽt	        |t        «      r~t        d„ |j                  «       D «       «      r^t        |«      dk7  s t        d„ |j                  «       D «       «      st        d	«      ‚t        t        |j                  «       «      «      \  }}|�Q|rt        d
«      ‚|j                  «        | j                  j!                  |j#                  «       |||«      ƒ d{  –—† S t	        |t$        j&                  «      r|g}t	        |t(        «      rFt        |D �ch c]  }t	        |t$        j&                  «      ’Œ c}«      rt%        j*                  |«      }|rI|rt        d«      ‚| j                  j-                  t)        |j                  «       «      ||«      ƒ d{  –—† S |rt        d«      ‚|€t        d«      ‚t	        |t$        j.                  «      r#| j                  j1                  |«      ƒ d{  –—† S | j                  j3                  t)        |j                  «       «      «      ƒ d{  –—† S 7 �ŒTc c}w 7 Œ�7 ŒH7 Œ­w)aº  
        Add new columns with defined values.

        Parameters
        ----------
        transforms: Dict[str, str | FunctionApplication] or FunctionApplication
            A map of column name to a SQL expression to use to calculate the
            value of the new column. These expressions will be evaluated for
            each row in the table, and can reference existing columns.
            Alternatively, you can pass a pyarrow field or schema to add
            new columns with NULLs.

            A mapping with one ``FunctionApplication`` value keeps its scalar
            or named-struct result in the named table column. A bare
            named-struct application expands its ordered result fields as one
            atomic binding; aliases come from ``rename(columns=...)``.
            Function columns are supported only on LanceDB Cloud and
            Enterprise.
        computed: Dict[str, str], optional
            Local declaration and refresh require a source build with the
            ``experimental-functions`` Cargo feature, which published packages
            do not enable. Remote Cloud/Enterprise operations remain available.

            A mapping from output column names to SQL expressions derives each
            output field from its expression. A direct projection of a Blob v2
            field inherits Blob v2 semantics; other expressions derive their
            ordinary Arrow type. Mapping order is declaration and dependency
            order.

            Unlike ``transforms``, the expression is stored rather than
            evaluated now: the column is committed with no values, and rows get
            them from
            [`refresh_column`][lancedb.table.AsyncTable.refresh_column].

            A refresh also recomputes the rows whose inputs changed since they
            were computed, so a mutated input is reflected by the next refresh.
            While a declaration reads a column, that column cannot be renamed,
            retyped or dropped.

            On LanceDB Cloud and Enterprise the expression is planned by
            the server. Cannot be combined with ``transforms``.

        auto_refresh_enabled: bool, optional
            Enable automatic refresh for each computed output declared by this
            call. Defaults to True. Local tables store the setting; automatic
            scheduling requires Cloud or Enterprise.
        auto_refresh_interval_seconds: int, optional
            Positive minimum seconds after a successful refresh before another
            automatic refresh is eligible. When omitted, the server determines when
            to refresh. Unchanged inputs do
            not force recomputation. Applies to every declared computed output.
            These options cannot be used with one-time transforms or ordinary
            all-null columns.

        Examples
        --------
        >>> await table.add_columns(  # doctest: +SKIP
        ...     computed={"total": "price * quantity"},
        ...     auto_refresh_enabled=True,
        ...     auto_refresh_interval_seconds=300,
        ... )

        Returns
        -------
        AddColumnsResult
            version: the new version number of the table after adding columns.

        Nz&auto_refresh_enabled must be a booleanr   l   ï'�Ý$zXauto_refresh_interval_seconds must be a positive integer no greater than u64::MAX / 1000c              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­wr¨   ©rn   rD   ©rž   rü   s     rh   r¡   z)AsyncTable.add_columns.<locals>.<genexpr>l  s   è ø€ ò 2
Ø7<ŒJ�uÔ1×2ñ2
ùó   ‚r   c              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­wr¨   rø  rù  s     rh   r¡   z)AsyncTable.add_columns.<locals>.<genexpr>o  s   è ø€ ò /Ø;@”
˜5Ô"5×6ñ/ùrú  z:one add_columns call declares exactly one Function bindingzGadd_columns cannot mix a Function application with SQL computed columnsz<add_columns cannot take both transforms and computed columnsz>automatic refresh options require computed or Function columnsz3add_columns requires transforms or computed columns)rû   rÎ   ró   rÉ   rn   rD   rô   r¢   r«   rq  r"  rU  rT  r<  Ú_ensure_declarablerŸ  Úadd_function_columnsÚto_canonical_jsonr  ÚFieldr
  r  Úadd_computed_columnsÚSchemaÚadd_columns_with_schemarY  )	rH  rX  rS  rT  rU  Úoptions_suppliedÚfunction_applicationÚfunction_output_namerô  s	            rh   rY  zAsyncTable.add_columns	  sº  è ø€ ðb  Ð+´Ð5IÓ0JÔRVÑ0VÜÐEÓFÐFØ(Ð4ÜÐ.Ó/´sÑ:ØÐ4ÔKÐ8KÒKäð2óð ð Läð2óð ð
 !¨Ð,ò 9Ø,°DÐ8ð 	ð  $ÐØ#ÐÜ�jÔ"5Ô6Ø#-Ñ Ü˜
¤DÔ)¬cñ 2
Ø@J×@QÑ@QÓ@Sô2
ô /
ô �:‹ !Ò#¬3ñ /ØDN×DUÑDUÓDWô/ô ,ô !ØPóð ô :>¼dÀ:×CSÑCSÓCUÓ>VÓ9WÑ6Ð Ð"6àÐ+ÙÜ ð'óð ð !×3Ñ3Ô5ØŸ™×9Ñ9Ø$×6Ñ6Ó8Ø$Ø$Ø-ó	÷ ð ô �j¤"§(¡(Ô+Ø$˜ˆJÜ�j¤$Ô'¬CØ.8Ö9¨ŒZ˜œ2Ÿ8™8Õ$Ò9ô-
ô Ÿ™ :Ó.ˆJÙÙÜ ØRóð ð Ÿ™×9Ñ9Ü�X—^‘^Ó%Ó&Ø$Ø-ó÷ ð ñ
 ÜØPóð ð ÐÜÐRÓSÐSÜ�j¤"§)¡)Ô,ØŸ™×<Ñ<¸ZÓH×HÐHàŸ™×0Ñ0´°j×6FÑ6FÓ6HÓ1IÓJ×JÐJðAûò :ðøð IøàJúsV   ‚EJ5ÅJ'Å:J5Æ!J*Æ/A"J5ÈJ/ÈAJ5É(J1É)9J5Ê"J3Ê#J5Ê*J5Ê1J5Ê3J5c              ƒ  óT   K  — | j                   j                  |«      ƒ d{  –—† S 7 Œ­w)aŽ  
        Fill the rows of a computed column that hold no value yet.

        Local refresh requires the ``experimental-functions`` Cargo feature
        in a source build. Published packages leave it disabled.

        Declared with ``add_columns(computed=...)``, a column starts empty and
        gets its values here. Rows appended since the last refresh are filled
        by the next one, and rows whose inputs changed since they were computed
        are recomputed; everything else is left as it is.

        Local tables only: a remote refresh runs as a server job, through
        [`refresh_column_async`][lancedb.table.Table.refresh_column_async].

        Parameters
        ----------
        column: str
            The name of the computed column to fill.

        Returns
        -------
        RefreshColumnResult
            The number of rows filled and the new version of the table.
        N)rŸ  r\  r[  s     rh   r\  zAsyncTable.refresh_column   s#   è ø€ ð2 —[‘[×/Ñ/°Ó7×7Ð7Ð7úr�  c              ƒ  óZ   K  — | j                   j                  |||¬«      ƒ d{  –—† S 7 Œ­w)a  
        The per-row errors Function refreshes recorded on this table.

        A refresh running under a skip policy records each row it skipped
        with the input that failed and the error. This lists those records,
        newest job first, plus a summary for any fragment whose per-row
        detail was capped. LanceDB Cloud and Enterprise only; reading errors
        needs read access to the table, since a message carries the value
        that failed.

        Parameters
        ----------
        job_id: str, optional
            Only errors recorded by this job.
        column: str, optional
            Only errors on this column.
        limit: int, optional
            At most this many records (server default 10000, cap 100000).

        Returns
        -------
        FunctionErrors
            ``records``, ``fragments`` and ``truncated``, the last saying
            whether the listing stopped at its limit.

        Examples
        --------
        >>> errors = await table.function_errors(column="embedding")  # doctest: +SKIP
        >>> for record in errors.records:  # doctest: +SKIP
        ...     print(record.job_id, record.row_offset, record.error_message)
        >>> if errors.truncated:  # doctest: +SKIP
        ...     print("listing stopped at the limit")
        rÀ  N)rŸ  rc  r`  s       rh   rc  zAsyncTable.function_errors»  s6   è ø€ ðN —[‘[×0Ñ0Ø &°ð 1ó 
÷ 
ð 	
ð 
úó   ‚"+¤)¥+c              ƒ  ó„   K  — t        | j                  j                  |«      ƒ d{  –—† t        j                  «      S 7 Œ­w)aá  
        Like :meth:`refresh_column`, but returns a handle to the refresh job
        instead of blocking until it completes.

        Local refresh requires a source build with ``experimental-functions``.
        Remote Cloud/Enterprise jobs do not require this feature.

        The job may already be complete when returned; callers must not assume
        the column is filled until :meth:`AsyncJob.wait` resolves. Invalid
        input -- an unknown column, or one that is not computed -- raises here
        rather than failing the job. On local tables the job runs
        in-process; on LanceDB Cloud and Enterprise it is the server's
        backfill job.

        Returns
        -------
        AsyncJob[RefreshColumnResult]
            A job whose successful ``wait`` returns row counts plus the source
            and published table versions.

        Examples
        --------
        >>> import asyncio
        >>> import lancedb
        >>> async def refresh_in_background():
        ...     db = await lancedb.connect_async("./.lancedb")
        ...     table = await db.create_table("computed_job_async_demo", [{"x": 1}])
        ...     await table.add_columns(computed={"doubled": "x * 2"})
        ...     job = await table.refresh_column_async("doubled")
        ...     result = await job.wait()
        ...     assert result.rows_assigned == 1
        ...     return await job.status()
        >>> asyncio.run(refresh_in_background())  # doctest: +SKIP
        'finished'
        N)r+   rŸ  r^  ÚRefreshColumnJobResultÚ	from_jsonr[  s     rh   r^  zAsyncTable.refresh_column_asyncæ  s7   è ø€ ôL Ø—+‘+×2Ñ2°6Ó:×:Ü"×,Ñ,ó
ð 	
Ø:ús   ‚$A ¦>§A c              ‡  óT   K  — | j                   j                  |«      ƒ d{  –—† S 7 Œ­w)a’  
        Alter column names and nullability.

        alterations : Iterable[Dict[str, Any]]
            A sequence of dictionaries, each with the following keys:
            - "path": str
                The column path to alter. For a top-level column, this is the name.
                For a nested column, this is the dot-separated path, e.g. "a.b.c".
            - "rename": str, optional
                The new name of the column. If not specified, the column name is
                not changed.
            - "data_type": pyarrow.DataType, optional
               The new data type of the column. Existing values will be casted
               to this type. If not specified, the column data type is not changed.
            - "nullable": bool, optional
                Whether the column should be nullable. If not specified, the column
                nullability is not changed. Only non-nullable columns can be changed
                to nullable. Currently, you cannot change a nullable column to
                non-nullable.

            Each alteration must specify at least one of "rename", "data_type",
            or "nullable". The legacy key "name" is also accepted for renaming.
            Unknown keys raise ValueError before any alterations are applied.

        Returns
        -------
        AlterColumnsResult
            version: the new version number of the table after the alteration.
        N)rŸ  rg  re  s     rh   rg  zAsyncTable.alter_columns  s$   è ø€ ð@ —[‘[×.Ñ.¨{Ó;×;Ð;Ð;úr�  c              ‡  óT   K  — | j                   j                  |«      ƒ d{  –—† S 7 Œ­w)zrUpdate per-field metadata. See
        [`Table.update_field_metadata`][lancedb.table.Table.update_field_metadata].N)rŸ  rk  ri  s     rh   rk  z AsyncTable.update_field_metadata3  s#   è ø€ ð
 —[‘[×6Ñ6°wÓ?×?Ð?Ð?úr�  c              ƒ  óT   K  — | j                   j                  |«      ƒ d{  –—† S 7 Œ­w)z£
        Drop columns from the table.

        Parameters
        ----------
        columns : Iterable[str]
            The names of the columns to drop.
        N)rŸ  rü  rx  s     rh   rü  zAsyncTable.drop_columns:  s#   è ø€ ð —[‘[×-Ñ-¨gÓ6×6Ð6Ð6úr�  c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)a‘  
        Retrieve the version of the table

        LanceDb supports versioning.  Every operation that modifies the table increases
        version.  As long as a version hasn't been deleted you can `[Self::checkout]`
        that version to view the data at that point.  In addition, you can
        `[Self::restore]` the version to replace the current table with a previous
        version.
        N)rŸ  rO  rG  s    rh   rO  zAsyncTable.versionE  s!   è ø€ ð —[‘[×(Ñ(Ó*×*Ð*Ð*úrx  c              ƒ  óØ   K  — | j                   j                  «       ƒ d{  –—† }|D ]<  }t        |d   d«      \  }}t        j                  |«      t        |dz  ¬«      z   |d<   Œ> |S 7 ŒG­w)z0
        List all versions of the table
        NÚ	timestampi Êš;r‚   )Úmicroseconds)rŸ  r„  Údivmodr   Úfromtimestampr   )rH  ÚversionsrH  rÀ  Únanoss        rh   r„  zAsyncTable.list_versionsQ  sv   è ø€ ð Ÿ™×2Ñ2Ó4×4ˆØò 	ˆAô $ A k¡N°MÓB‰NˆG�UÜ%×3Ñ3°GÓ<¼yØ" d™]ô@ñ ˆAˆkŠNð		ð ˆð 5ús   ‚A* A(¡AA*c              ƒ  ó´   K  — 	 | j                   j                  |«      ƒ d{  –—†  y7 Œ# t        $ r"}dt        |«      v rt	        d|› d�«      ‚‚ d}~ww xY w­w)rz  Nz	not foundzVersion z% no longer exists. Was it cleaned up?)rŸ  r|  rt   ro   ró   )rH  rO  r*  s      rh   r|  zAsyncTable.checkout`  s]   è ø€ ð,	Ø—+‘+×&Ñ& wÓ/×/Ò/ùÜò 	Øœc !›fÑ$Ü Ø˜w˜iÐ'LÐMóð ð ûð	üs0   ‚A„* ¢(£* §A¨* ª	A³AÁAÁAc              ƒ  óT   K  — | j                   j                  «       ƒ d{  –—†  y7 Œ­wr~  )rŸ  r  rG  s    rh   r  zAsyncTable.checkout_latest€  s   è ø€ ð �k‰k×)Ñ)Ó+×+Ò+úrv  c              ƒ  óV   K  — | j                   j                  |«      ƒ d{  –—†  y7 Œ­w)aè  
        Restore the table to the currently checked out version

        This operation will fail if checkout has not been called previously

        This operation will overwrite the latest version of the table with a
        previous version.  Any changes made since the checked out version will
        no longer be visible.

        Once the operation concludes the table will no longer be in a checked
        out state and the read_consistency_interval, if any, will apply.
        N)rŸ  r�  r{  s     rh   r�  zAsyncTable.restoreŠ  s    è ø€ ð �k‰k×!Ñ! 'Ó*×*Ò*úrt  rî  c               ót   — t        | j                  j                  |«      | «      }|r|j                  «        |S )a¦  
        Take a list of offsets from the table.

        Offsets are 0-indexed and relative to the current version of the table.  Offsets
        are not stable.  A row with an offset of N may have a different offset in a
        different version of the table (e.g. if an earlier row is deleted).

        Offsets are mostly useful for sampling as the set of all valid offsets is easily
        known in advance to be [0, len(table)).

        No guarantees are made regarding the order in which results are returned.
        Repeated offsets produce repeated rows.

        Parameters
        ----------
        offsets: list[int]
            The offsets to take.
        with_row_id: bool, default False
            If True, include the "_rowid" column in the results.

        Returns
        -------
        AsyncTakeQuery
            A query object that can be executed to get the rows at the given
            offsets.
        )rM   rŸ  rñ  rï  )rH  r­  rï  r4  s       rh   rñ  zAsyncTable.take_offsets™  s3   € ô: ˜tŸ{™{×7Ñ7¸Ó@À$ÓGˆÙØ×ÑÔØˆrj   c               ót   — t        | j                  j                  |«      | «      }|r|j                  «        |S )aã  
        Take a list of row ids from the table.

        Row ids are not stable and are relative to the current version of the table.
        They can change due to compaction and updates.

        Unlike offsets, row ids are not 0-indexed and no assumptions should be made
        about the possible range of row ids.  In order to use this method you must
        first obtain the row ids by scanning or searching the table.

        Even so, row ids are more stable than offsets and can be useful in some
        situations.

        There is an ongoing effort to make row ids stable which is tracked at
        https://github.com/lancedb/lancedb/issues/1120

        Parameters
        ----------
        row_ids: list[int]
            The row ids to take.
        with_row_id: bool, default False
            If True, include the "_rowid" column in the results.

        Returns
        -------
        AsyncTakeQuery
            A query object that can be executed to get the rows.
        )rM   rŸ  r  rï  )rH  r  rï  r4  s       rh   r  zAsyncTable.take_row_ids»  s3   € ô> ˜tŸ{™{×7Ñ7¸Ó@À$ÓGˆÙØ×ÑÔØˆrj   c              ƒ  óR   K  — | j                   j                  «       ƒ d {  –—† S 7 Œ­wr¨   )rŸ  r  rG  s    rh   r  zAsyncTable.blob_columnsß  s   è ø€ Ø—[‘[×-Ñ-Ó/×/Ð/Ð/úrx  c              ƒ  ój   K  — | j                   j                  |t        ||«      «      ƒ d {  –—† S 7 Œ­wr¨   )rŸ  r  r!   r
  s      rh   r  zAsyncTable.fetch_blobsâ  s6   è ø€ ð
 —[‘[×,Ñ,ØÔ+¨G°VÓ<ó
÷ 
ð 	
ð 
úó   ‚*3¬1­3c              ƒ  óh   K  — | j                   j                  |t        |«      «      ƒ d {  –—† S 7 Œ­wr¨   )rŸ  r  r
  r  s      rh   r  zAsyncTable.fetch_blob_rangesë  s)   è ø€ ð
 —[‘[×2Ñ2°6¼4À»>ÓJ×JÐJÐJúó   ‚)2«0¬2c              ƒ  ó€   K  — | j                   j                  |t        ||«      «      ƒ d {  –—† }t        |«      S 7 Œ­wr¨   )rŸ  r  r!   r"   )rH  r$  r  Úhandless       rh   r  zAsyncTable.fetch_blob_filesò  s@   è ø€ ð
 Ÿ™×4Ñ4ØÔ+¨G°VÓ<ó
÷ 
ˆô   Ó(Ð(ð
ús   ‚*>¬<­>c              ƒ  ó¨   K  — t        |«      }|€yt        | j                  j                  t	        j
                  |«      «      ƒ d{  –—† «      S 7 Œ­w)z†Open a snapshot-bound descriptor as a seekable file.

        See [Table.open_blob_file][lancedb.table.Table.open_blob_file].
        N)r    r   rŸ  r  rå  ræ  r  s     rh   r  zAsyncTable.open_blob_fileü  sD   è ø€ ô 0°
Ó;ˆ
ØÐØÜ˜dŸk™k×8Ñ8¼¿¹ÀJÓ9OÓP×PÓQÐQÐPús   ‚AAÁAÁ	Ac               óV   K  — |D ]  }| j                  |«      ƒ d{  –—† ­–— Œ  y7 Œ
­w)až  Asynchronously iterate over files in descriptor order, preserving nulls.

        Use ``async for file in table.open_blob_files(descriptors)``. Each
        non-null file must be closed after use.

        ```python
        async for video in videos.open_blob_files(rows["video"]):
            if video is not None:
                with video:
                    payload = await video.aread()
        ```
        Nr  r  s      rh   r  zAsyncTable.open_blob_files  s.   è ø€ ð &ò 	8ˆJØ×+Ñ+¨JÓ7×7Ô7ñ	8Ø7ús   ‚)œ'�)c                ó,   — t        | j                  «      S )a“  Tag management for the dataset.

        Similar to Git, tags are a way to add metadata to a specific version of the
        dataset.

        .. warning::

            Tagged versions are exempted from the
            :py:meth:`optimize(cleanup_older_than)` process.

            To remove a version that has been tagged, you must first
            :py:meth:`~Tags.delete` the associated tag.

        )Ú	AsyncTagsrŸ  rG  s    rh   rS  zAsyncTable.tags  s   € ô  ˜Ÿ™Ó%Ð%rj   c                ó,   — t        | j                  «      S )rU  )ÚAsyncBranchesrŸ  rG  s    rh   rV  zAsyncTable.branches,  s   € ô ˜TŸ[™[Ó)Ð)rj   c                ó6   — | j                   j                  «       S rF  )rŸ  rY  rG  s    rh   rY  zAsyncTable.current_branch5  rG  rj   r@  c             ƒ  óX   K  — | j                  t        ||«      ||«      ƒ d{  –—† S 7 Œ­wrC  )r·  r�   rD  s        rh   rE  zAsyncTable.optimize9  s7   è ø€ ðx ×&Ñ&Ü&Ð'9¸7ÓCØØó
÷ 
ð 	
ð 
ús   ‚!*£(¤*c              ƒ  óZ   K  — | j                   j                  |||¬«      ƒ d {  –—† S 7 Œ­w)N)rŽ   r9  rA  )rŸ  rE  )rH  rŽ   r9  rA  s       rh   r·  zAsyncTable._do_optimize{  s7   è ø€ ð —[‘[×)Ñ)Ø-Ø/Ø1ð *ó 
÷ 
ð 	
ð 
úr  c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­w)r¹  N)rŸ  rG  rG  s    rh   rG  zAsyncTable.list_indices‡  s!   è ø€ ð —[‘[×-Ñ-Ó/×/Ð/Ð/úrx  rH  c             ƒ  óZ   K  — | j                   j                  |||¬«      ƒ d{  –—† S 7 Œ­w)rK  rH  N)rŸ  rM  rL  s       rh   rM  zAsyncTable.tokenize�  s*   è ø€ ð( —[‘[×)Ñ)¨%¸È:Ð)ÓV×VÐVÐVúr  c              ƒ  óp   K  — | j                   j                  |«      ƒ d{  –—† }|€yt        di |¤ŽS 7 Œ­w)rO  Nre   )rŸ  rQ  ÚIndexStatistics)rH  rI  rÉ  s      rh   rQ  zAsyncTable.index_stats£  s:   è ø€ ð —k‘k×-Ñ-¨jÓ9×9ˆØˆ=Øä"Ñ+ UÑ+Ð+ð	 :ús   ‚6¡4¢6c              ƒ  óR   K  — | j                   j                  «       ƒ d{  –—† S 7 Œ­wr™  )rŸ  r›  rG  s    rh   r›  z!AsyncTable.uses_v2_manifest_paths·  s!   è ø€ ð —[‘[×7Ñ7Ó9×9Ð9Ð9úrx  c              ƒ  óT   K  — | j                   j                  «       ƒ d{  –—†  y7 Œ­w)az  
        Migrate the manifest paths to the new format.

        This will update the manifest to use the new v2 format for paths.

        This function is idempotent, and can be run multiple times without
        changing the state of the object store.

        !!! danger

            This should not be run while other concurrent operations are happening.
            And it should also run until completion before resuming other operations.

        You can use
        [AsyncTable.uses_v2_manifest_paths][lancedb.table.AsyncTable.uses_v2_manifest_paths]
        to check if the table is already using the new path style.
        N)rŸ  rÞ  rG  s    rh   rÞ  z$AsyncTable.migrate_manifest_paths_v2Â  s   è ø€ ð$ �k‰k×3Ñ3Ó5×5Ò5úrv  rl  rm  rn  c              ƒ  óX   K  — | j                   j                  ||«      ƒ d{  –—†  y7 Œ­wrà  )rŸ  rv  rt  s      rh   rv  z!AsyncTable.replace_field_metadataÖ  s"   è ø€ ð* �k‰k×0Ñ0°¸\ÓJ×JÒJúr—  )
r!  rã  r  rÆ  rf   rá  rg   râ  r  rÎ   )
r  rÆ  rf   rá  rg   râ  r  rÎ   r£  rä  rÿ  ró  rô  r   rõ  rö  r¢  r¦  r­  r¨   r®  ræ  rè  )r£  rL   r²  r¯  ré  r°  )r$  ro   r§  r½  rw  úcOptional[Union[IvfFlat, IvfPq, IvfRq, HnswPq, HnswSq, HnswFlat, BTree, Bitmap, LabelList, Fm, FTS]]r¨  r·  rù   r¬  r©  rÎ   )r$  ro   r§  r½  rw  r3  r¨  r·  rù   r¬  r©  rÎ   r£  r)   r¾  rê  r¿  rÁ  rë  )rë   r2   rÜ  z(Optional[Literal['append', 'overwrite']]r[  zOptional[OnBadVectorsType]r\  zOptional[float]rA  rË  rÝ  rÌ   rÞ  rÎ   r£  r·   rÌ  )NNrÏ  NN)r4  r¸  rz  r¬  ré  rÁ   rê  r¬  rë  rÅ  r£  rL   )N.NN)r4  ro   rz  r¬  ré  úLiteral['auto']rê  r¬  rë  rÅ  r£  z8Union[AsyncHybridQuery, AsyncFTSQuery, AsyncVectorQuery])r4  ro   rz  r¬  ré  rñ  rê  r¬  rë  rÅ  r£  rK   )r4  z$Union[VEC, 'PIL.Image.Image', Tuple]rz  r¬  ré  r4  rê  r¬  rë  rÅ  r£  rN   )r4  ro   rz  r¬  ré  rï  rê  r¬  rë  rÅ  r£  rJ   )r4  z8Union[VEC, str, 'PIL.Image.Image', Tuple, FullTextQuery]rz  r¬  ré  rî  rê  r¬  rë  rÅ  r£  rN   )r4  rÑ  rz  r¬  ré  rÁ   rê  r¬  rë  rÅ  r£  zDUnion[AsyncQuery, AsyncHybridQuery, AsyncFTSQuery, AsyncVectorQuery])rÃ  zUnion[VEC, Tuple]r£  rN   )r4  rW   r£  zQAsyncHybridQuery | AsyncFTSQuery | AsyncVectorQuery | AsyncQuery | AsyncTakeQueryrÝ  rà  rá  râ  rã  rä  )rj  zOptional[Dict[str, Any]]r1  rç  r¤  ré  r£  r¿   )
rX  zidict[str, str | FunctionApplication] | FunctionApplication | pa.Field | List[pa.Field] | pa.Schema | NonerS  zdict[str, str] | NonerT  rò  rU  ró  r£  rµ   )r$  ro   r£  rE   rö  r÷  )r$  ro   r£  z AsyncJob[RefreshColumnJobResult])rf  zIterable[dict[str, Any]]r£  r¸   rù  )r  rÀ  r¥  )rO  z	int | str)rO  zOptional[int | str])r­  rÓ  rï  rÎ   r£  rM   )r  rÓ  rï  rÎ   r£  rM   rÖ  r×  rÚ  rÛ  rÜ  )r  r   r£  z!AsyncIterator[Optional[BlobFile]])r£  r&  )r£  r(  r«  )rŒ   r·  r9  rÎ   rA  rì  r£  r±   )rŽ   rÌ   r9  rÎ   rA  rì  r£  r±   rí  rî  rï  )rñ  ro   ru  zdict[str, str])Zrà   rá   râ   rã   r  ri  rR  rl  rn  rp  rˆ  rÅ  rÇ  rË  rÎ  rŸ  r¡  rÐ  rÒ  rÔ  rØ  rÛ  r  rù   r  r^  r[  rV  r4  rn  rf  rA  r¬  r»  r¾  rs  rv  r   rÆ  rÉ  rì   r|  r  rß  rå  r   rí  rÄ  rÕ  r  r!  r'  r*  r/  r2  r7  rY  r\  rc  r^  rg  rk  rü  rO  r„  r|  r  r�  rñ  r  r  r  r  r  r  r  rS  rV  rY  rE  r·  rG  rM  rQ  r›  rÞ  r  r  r   rv  re   rj   rh   r  r  [  s€	  „ ñ@ðL /3Ø*.Ø-1Ø',ñ>àð>ð ,ð	>ð
 (ð>ð +ð>ð !%ó>ð6 /3Ø*.Ø-1Ø',ñð ,ðð (ð	ð
 +ðð !%ðð 
óò&òòó%ò#ð>Ø0ð>à	ó>ó2#+óJ(ó0ó"6ó,ó+ó,&ó(ð /4ñEØ'+ðEà	óEó*.ð ò"ó ð"ó*óYô	4ô	6ó	5ó1ôf PðD 7=õ @ðH #'ð Ø,0Ø"Øñ-^àð^ð  ð	^ð

ð^ð( *ð)^ð* ð+^ð, ó-^ðH #'ð Ø,0Ø"Øñ-&àð&ð  ð	&ð

ð&ð( *ð)&ð* ð+&ð, ð-&ð. 
ó/&óP+ó(.ô,0ñ0 @IÐQTÔ?Uð?Ø(ð?Ø3<ð?à	ó?ó")ó'ó;ó:ð( :BØ59Ø&*Ø9=Ø+/Ø27ñl!àðl!ð 7ð	l!ð
 3ðl!ð $ðl!ð 7ðl!ð )ðl!ð ,0ðl!ð 
ól!ó\>1ð@ ð Ø,0Ø &Ø-1Ø7;ðàðð *ðð ð	ð
 +ðð 5ðð 
òó ðð ð -1Ø&)Ø-1Ø7;ðGàðGð *ðGð $ð	Gð
 +ðGð 5ðGð 
BòGó ðGð ð -1Ø(+Ø-1Ø7;ðàðð *ðð &ð	ð
 +ðð 5ðð 
òó ðð ð -1Ø&)Ø-1Ø7;ðà3ðð *ðð $ð	ð
 +ðð 5ðð 
òó ðð ð -1Ø%(Ø-1Ø7;ðàðð *ðð #ð	ð
 +ðð 5ðð 
òó ðð ð -1Ø(+Ø-1Ø7;ðàGðð *ðð &ð	ð
 +ðð 5ðð 
òó ðð Ø,0Ø &Ø-1Ø7;ð}Dð
ð}Dð
 *ð}Dð ð}Dð +ð}Dð 5ð}Dð 
Nó}Dð~5à'ð5ð 
ó5ðHØðHð	óHð\ %)Ø'+ñ
àð
ð "ð	
ð
 %ð
ð 
ó
ó<7ð >Iñ	CàðCð ;ð	Cð
 
óCó1ð%
à&ð%
ð ð%
ð )ð	%
ð
 ð%
ð 
ó%
óN33ðn -1ð?@ð -1Ø04ñ?@à)ð?@ð *ð	?@ð
 .ð?@ð 
ó?@ðP ðUKð +/Ø,0Ø48ñUKððUKð (ðUKð *ðUKð (2ðUKð 
óUKón8ð: !%Ø $Ø#ð	)
àð)
ð ð)
ð ð	)
ð
 
ó)
ðV)
Øð)
à	)ó)
ðV <Ø4ð <à	ó <ðD@Ø&ð@à	"ó@ó	7ó
+òóò@,ô+ð  :?ñ Ø ð Ø26ð à	ó ðF :?ñ"Ø ð"Ø26ð"à	ó"óH0ð
àð
ð Gð
ð 
ó	
ðKàðKð *ðKð 
ó	Kð)àð)ð Gð)ð 
$ó	)ð
RØ<ð
Rà	ó
Rð8Ø#ð8à	*ó8ð$ ò&ó ð&ð" ò*ó ð*ó,ð 37Ø"'ØØ:>ñ@
ð 0ð@
ð  ð	@
ð 8ð@
ð 
ó@
ðL ;?ð	

à'ð

ð  ð

ð 8ð	

ð
 
ó

ó0ð !%Ø$(ñWàðWð ð	Wð
 "ðWð 
óWó,,ó(	:ò6ð( €[×ÑØØ#Ø6ôð
KØðKØ-;òKóñ
Krj   r  c                  óR   — e Zd ZU dZded<   ded<   ded<   dZded	<   dZd
ed<   d„ Zy)r/  aÕ  
    Statistics about an index.

    Attributes
    ----------
    num_indexed_rows: int
        The number of rows that are covered by this index.
    num_unindexed_rows: int
        The number of rows that are not covered by this index.
    index_type: str
        The type of index that was created.
    distance_type: Optional[str]
        The distance type used by the index.
    num_indices: Optional[int]
        The number of parts the index is split into.
    rÉ   Únum_indexed_rowsÚnum_unindexed_rowszˆLiteral['IVF_FLAT', 'IVF_SQ', 'IVF_PQ', 'IVF_RQ', 'IVF_HNSW_SQ', 'IVF_HNSW_PQ', 'IVF_HNSW_FLAT', 'FTS', 'BTREE', 'BITMAP', 'LABEL_LIST']rŽ  Nz(Optional[Literal['l2', 'cosine', 'dot']]r  rÌ   Únum_indicesc                ó   — t        | |«      S r¨   )r“   )rH  r  s     rh   Ú__getitem__zIndexStatistics.__getitem__  s   € Ü�t˜SÓ!Ð!rj   )rà   rá   râ   rã   rä   r  r8  r:  re   rj   rh   r/  r/  î  s<   … ñð" ÓØÓðó ð ?C€MÐ;ÓBØ!%€K�Ó%ó"rj   r/  c                  óD   — e Zd ZU dZded<   ded<   ded<   ded<   ded	<   y
)rÂ  aæ  
    Statistics about a table and fragments.

    Attributes
    ----------
    total_bytes: int
        The total size, in bytes, of the table's data files, index files, and
        overlay files. Read from the manifest, so this excludes deletion files
        and manifests.
    num_rows: int
        The total number of rows in the table.
    num_deleted_rows: Optional[int]
        The total number of rows marked as deleted across all fragments of the
        table. These rows are not counted in ``num_rows``, but still occupy space
        on disk until the table is compacted, so a large value here indicates
        that the table should be optimized. Fragments in which every row was
        deleted are dropped outright, so their rows are not counted here.
        ``None`` when the backend does not report deletion counts.
    num_indices: int
        The total number of indices in the table.
    fragment_stats: FragmentStatistics
        Statistics about fragments in the table.
    rÉ   Útotal_bytesr  rÌ   Únum_deleted_rowsr8  ÚFragmentStatisticsÚfragment_statsNrß   re   rj   rh   rÂ  rÂ    s&   … ñð0 ÓØƒMØ#Ó#ØÓØ&Ô&rj   rÂ  c                  ó0   — e Zd ZU dZded<   ded<   ded<   y)r>  a–  
    Statistics about fragments.

    Attributes
    ----------
    num_fragments: int
        The total number of fragments in the table.
    num_small_fragments: int
        The total number of small fragments in the table.
        Small fragments have low row counts and may need to be compacted.
    lengths: FragmentSummaryStats
        Statistics about the number of rows in the table fragments.
    rÉ   Únum_fragmentsÚnum_small_fragmentsÚFragmentSummaryStatsr`  Nrß   re   rj   rh   r>  r>  :  s   … ñð ÓØÓØ!Ô!rj   r>  c                  óX   — e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded<   ded	<   y
)rC  aW  
    Statistics about fragments sizes

    Attributes
    ----------
    min: int
        The number of rows in the fragment with the fewest rows.
    max: int
        The number of rows in the fragment with the most rows.
    mean: int
        The mean number of rows in the fragments.
    p25: int
        The 25th percentile of number of rows in the fragments.
    p50: int
        The 50th percentile of number of rows in the fragments.
    p75: int
        The 75th percentile of number of rows in the fragments.
    p99: int
        The 99th percentile of number of rows in the fragments.
    rÉ   rN  rO  ÚmeanÚp25Úp50Úp75Úp99Nrß   re   rj   rh   rC  rC  O  s,   … ñð* 
ƒHØ	ƒHØ
ƒIØ	ƒHØ	ƒHØ	ƒHØ	„Hrj   rC  c                  ó>   — e Zd ZdZd„ Zd	d„Zd
d„Zdd„Zdd„Zdd„Z	y)r©  z
    Table tag manager.
    c                ó   — || _         y r¨   ©r  ©rH  r!  s     rh   r  zTags.__init__t  ó	   € Øˆ�rj   c                óp   — t        j                  | j                  j                  j	                  «       «      S )ú�
        List all table tags.

        Returns
        -------
        dict[str, Tag]
            A dictionary mapping tag names to version numbers.
        )r'   r  r  rS  r
  rG  s    rh   r
  z	Tags.listw  s&   € ô �x‰x˜Ÿ™×(Ñ(×-Ñ-Ó/Ó0Ð0rj   c                ór   — t        j                  | j                  j                  j	                  |«      «      S )úœ
        Get the version of a tag.

        Parameters
        ----------
        tag: str,
            The name of the tag to get the version for.
        )r'   r  r  rS  Úget_version©rH  Útags     rh   rS  zTags.get_version‚  s(   € ô �x‰x˜Ÿ™×(Ñ(×4Ñ4°SÓ9Ó:Ð:rj   c                óv   — t        j                  | j                  j                  j	                  ||«      «       y©a!  
        Create a tag for a given table version.

        Parameters
        ----------
        tag: str,
            The name of the tag to create. This name must be unique among all tag
            names for the table.
        version: int,
            The table version to tag.
        N)r'   r  r  rS  r–  ©rH  rU  rO  s      rh   r–  zTags.create�  s'   € ô 	�‰�—‘×!Ñ!×(Ñ(¨¨gÓ6Õ7rj   c                ót   — t        j                  | j                  j                  j	                  |«      «       y©z�
        Delete tag from the table.

        Parameters
        ----------
        tag: str,
            The name of the tag to delete.
        N)r'   r  r  rS  r2  rT  s     rh   r2  zTags.delete›  s%   € ô 	�‰�—‘×!Ñ!×(Ñ(¨Ó-Õ.rj   c                óv   — t        j                  | j                  j                  j	                  ||«      «       y©zÒ
        Update tag to a new version.

        Parameters
        ----------
        tag: str,
            The name of the tag to update.
        version: int,
            The new table version to tag.
        N)r'   r  r  rS  r7  rX  s      rh   r7  zTags.update¦  s'   € ô 	�‰�—‘×!Ñ!×(Ñ(¨¨gÓ6Õ7rj   N©r£  zDict[str, Tag]©rU  ro   r£  rÉ   ©rU  ro   rO  rÉ   r£  r¸  ©rU  ro   r£  r¸  ©
rà   rá   râ   rã   r  r
  rS  r–  r2  r7  re   rj   rh   r©  r©  o  s%   „ ñòó	1ó	;ó8ó	/ô8rj   r©  c                  óv   — e Zd ZdZdd„Zdd„Z	 	 d	 	 	 	 	 	 	 dd„Zddd„Zdd„Zdd„Z	ddd	„Z
	 d	 	 	 	 	 dd
„Zy)rD  z
    Table branch manager.
    c                ó4   — || _         |j                  | _        y r¨   )Ú_parentr  )rH  Úparents     rh   r  zBranches.__init__¹  s   € ØˆŒØ—m‘mˆ�rj   c                óp   — t        j                  | j                  j                  j	                  «       «      S )ú3List all branches, mapping name to branch metadata.)r'   r  r  rV  r
  rG  s    rh   r
  zBranches.list½  s$   € ä�x‰x˜Ÿ™×,Ñ,×1Ñ1Ó3Ó4Ð4rj   Nc                ó˜   — t        j                  | j                  j                  j	                  |||«      «      }| j                  |«      S )áj  Create a branch and return a handle scoped to it.

        Parameters
        ----------
        name: str
            Name of the new branch.
        from_ref: str, optional
            Source branch to fork from. Defaults to ``main``.
        from_version: int, optional
            A specific version on ``from_ref`` to fork from. Defaults to latest.
        )r'   r  r  rV  r–  Ú_wrap)rH  rù   Úfrom_refÚfrom_versionrJ  s        rh   r–  zBranches.createÁ  s?   € ô" —h‘hØ�K‰K× Ñ ×'Ñ'¨¨h¸ÓEó
ˆð �z‰z˜+Ó&Ð&rj   c                ó˜   — t        j                  | j                  j                  j	                  ||«      «      }| j                  ||«      S )á›  Check out an existing branch and return a handle scoped to it.

        Parameters
        ----------
        name: str
            Name of the branch to check out.
        version: int, optional
            A specific version on the branch to pin. When set, the returned
            handle is a read-only view of that version; when omitted it tracks
            the branch's latest and stays writable.
        )r'   r  r  rV  r|  rj  )rH  rù   rO  rJ  s       rh   r|  zBranches.checkout×  s:   € ô —h‘h˜tŸ{™{×3Ñ3×<Ñ<¸TÀ7ÓKÓLˆØ�z‰z˜+ wÓ/Ð/rj   c                ót   — t        j                  | j                  j                  j	                  |«      «       y©zDelete a branch.N)r'   r  r  rV  r2  r½  s     rh   r2  zBranches.deleteæ  s#   € ä�‰�—‘×%Ñ%×,Ñ,¨TÓ2Õ3rj   c                ór   — t        j                  | j                  j                  j	                  |«      «      S )úDiff a branch against main.)r'   r  r  rV  Údiff©rH  Úfrom_branchs     rh   rs  zBranches.diffê  s&   € ä�x‰x˜Ÿ™×,Ñ,×1Ñ1°+Ó>Ó?Ð?rj   c                ót   — t        j                  | j                  j                  j	                  ||«      «      S )au  Cherry-pick a branch onto main, or dry-run.

        Parameters
        ----------
        from_branch: str
            Branch to cherry-pick from.
        dry_run: bool, default False
            When True, only preview. When False, attempt the cherry-pick.

        Notes
        -----
        A failed cherry-pick returns ``status="failed"`` instead of raising.
        )r'   r  r  rV  Úcherry_pick©rH  ru  Údry_runs      rh   rw  zBranches.cherry_pickî  s*   € ô �x‰x˜Ÿ™×,Ñ,×8Ñ8¸ÀgÓNÓOÐOrj   c                ó:   — | j                   j                  ||«      S r¨   )rd  rK  rI  s      rh   rj  zBranches._wrapþ  s   € ð �|‰|×/Ñ/°¸WÓEÐErj   )re  rå  ©r£  úDict[str, Any]rå  )rù   ro   rk  r¬  rl  rÌ   r£  ú'Table'r¨   )rù   ro   rO  rÌ   r£  r}  r¾  ©ru  ro   r£  r|  rß  ©ru  ro   ry  rÎ   r£  r|  )rJ  rä  rO  rÌ   r£  r}  )rà   rá   râ   rã   r  r
  r–  r|  r2  rs  rw  rj  re   rj   rh   rD  rD  ´  s‚   „ ñó$ó5ð #'Ø&*ð	'àð'ð  ð'ð $ð	'ð
 
ó'ô,0ó4ó@ôPð" CGðFØ'ðFØ2?ðFà	ôFrj   rD  c                  ó>   — e Zd ZdZd„ Zd	d„Zd
d„Zdd„Zdd„Zdd„Z	y)r&  z"
    Async table tag manager.
    c                ó   — || _         y r¨   rL  rM  s     rh   r  zAsyncTags.__init__   rN  rj   c              ƒ  óf   K  — | j                   j                  j                  «       ƒ d{  –—† S 7 Œ­w)rP  N)r  rS  r
  rG  s    rh   r
  zAsyncTags.list   s'   è ø€ ð —[‘[×%Ñ%×*Ñ*Ó,×,Ð,Ð,úó   ‚(1ª/«1c              ƒ  óh   K  — | j                   j                  j                  |«      ƒ d{  –—† S 7 Œ­w)rR  N)r  rS  rS  rT  s     rh   rS  zAsyncTags.get_version   s)   è ø€ ð —[‘[×%Ñ%×1Ñ1°#Ó6×6Ð6Ð6úr   c              ƒ  ól   K  — | j                   j                  j                  ||«      ƒ d{  –—†  y7 Œ­wrW  )r  rS  r–  rX  s      rh   r–  zAsyncTags.create%   s(   è ø€ ð �k‰k×Ñ×%Ñ% c¨7Ó3×3Ò3úó   ‚*4¬2­4c              ƒ  ój   K  — | j                   j                  j                  |«      ƒ d{  –—†  y7 Œ­wrZ  )r  rS  r2  rT  s     rh   r2  zAsyncTags.delete3   s&   è ø€ ð �k‰k×Ñ×%Ñ% cÓ*×*Ò*úó   ‚)3«1¬3c              ƒ  ól   K  — | j                   j                  j                  ||«      ƒ d{  –—†  y7 Œ­wr\  )r  rS  r7  rX  s      rh   r7  zAsyncTags.update>   s(   è ø€ ð �k‰k×Ñ×%Ñ% c¨7Ó3×3Ò3úr†  Nr]  r^  r_  r`  ra  re   rj   rh   r&  r&     s%   „ ñòó	-ó	7ó4ó	+ô4rj   r&  c                  ój   — e Zd ZdZd„ Zd
d„Z	 	 d	 	 	 	 	 	 	 dd„Zddd„Zdd„Zdd„Z		 d	 	 	 	 	 dd	„Z
y)r(  zAsync table branch manager.c                ó   — || _         y r¨   rL  rM  s     rh   r  zAsyncBranches.__init__O   rN  rj   c              ƒ  óf   K  — | j                   j                  j                  «       ƒ d{  –—† S 7 Œ­w)rg  N)r  rV  r
  rG  s    rh   r
  zAsyncBranches.listR   s%   è ø€ à—[‘[×)Ñ)×.Ñ.Ó0×0Ð0Ð0úrƒ  Nc              ƒ  ó�   K  — |dk(  rd}| j                   j                  j                  |||«      ƒ d{  –—† }t        |«      S 7 Œ­w)ri  ÚmainN)r  rV  r–  r  )rH  rù   rk  rl  Úinners        rh   r–  zAsyncBranches.createV   sG   è ø€ ð& �vÒØˆHØ—k‘k×*Ñ*×1Ñ1°$¸À,ÓO×OˆÜ˜%Ó Ð ð Pús   ‚2A´AµAc              ƒ  ó|   K  — t        | j                  j                  j                  ||«      ƒ d{  –—† «      S 7 Œ­w)rn  N)r  r  rV  r|  )rH  rù   rO  s      rh   r|  zAsyncBranches.checkoutn   s0   è ø€ ô  §¡× 4Ñ 4× =Ñ =¸dÀGÓ L×LÓMÐMÐLús   ‚/<±:²	<c              ƒ  ój   K  — | j                   j                  j                  |«      ƒ d{  –—†  y7 Œ­wrp  )r  rV  r2  r½  s     rh   r2  zAsyncBranches.delete|   s$   è ø€ à�k‰k×"Ñ"×)Ñ)¨$Ó/×/Ò/úrˆ  c              ƒ  óh   K  — | j                   j                  j                  |«      ƒ d{  –—† S 7 Œ­w)rr  N)r  rV  rs  rt  s     rh   rs  zAsyncBranches.diff€   s'   è ø€ à—[‘[×)Ñ)×.Ñ.¨{Ó;×;Ð;Ð;úr   c              ƒ  ój   K  — | j                   j                  j                  ||«      ƒ d{  –—† S 7 Œ­w)z‚Cherry-pick a branch onto main, or dry-run.

        A failed cherry-pick returns ``status="failed"`` instead of raising.
        N)r  rV  rw  rx  s      rh   rw  zAsyncBranches.cherry_pick„   s+   è ø€ ð —[‘[×)Ñ)×5Ñ5°kÀ7ÓK×KÐKÐKúr  r{  rå  )rù   ro   rk  r¬  rl  rÌ   r£  rä  r¨   )rù   ro   rO  rÌ   r£  rä  r¾  r~  rß  r  )rà   rá   râ   rã   r  r
  r–  r|  r2  rs  rw  re   rj   rh   r(  r(  L   sx   „ Ù%òó1ð #'Ø&*ð	!àð!ð  ð!ð $ð	!ð
 
ó!ô0Nó0ó<ð
 16ðLØðLØ)-ðLà	ôLrj   r(  )rf   rá  rg   r  r£  rÎ   )rx   r   r£  r¸  )r}   r   r£  r   )rŒ   r·  r�   rÎ   r£  rÌ   )r•   ÚBaseExceptionr–   ro   r£  r¸  )r    ro   r£  rÎ   )r•   r”  r    ro   r¥   r¬  r£  r¸  )rü   r   r£  rè  )rë   r   r  rò  r£  zOptional[pa.Table]r¨   )r  rò  r£  rÞ  )rë   r   r  rò  r£  rÞ  )NNrÈ  rÉ  )rë   z'DATA'r]  rò  r;  rè  r[  rÂ   r\  rÐ   rX  rÎ   r£  rÞ  rß  )re  rÞ  r]  r§  rX  rÎ   r£  rÞ  )rv  r§  rw  r§  r£  r§  )r‡  rØ  rˆ  rØ  r£  rØ  )rQ  rÔ  r]  r§  r£  rÔ  )r$  úpa.Arrayr“  rØ  r£  r•  )r$  r•  r´  rØ  r£  r•  )r«   r•  r“  rØ  r£  r•  )r  r•  r£  ztuple[pa.Array, pa.DataType])rÂ  úpa.DataTyper£  rÎ   )r  rØ  r£  r¬  )r  rØ  r£  rÎ   )r  rØ  r£  z Optional[_JsonSerializationPlan])r  r§  r£  z!Dict[str, _JsonSerializationPlan])rü   r   râ  r×  r£  r   )rë   r   r]  rò  r£  r   )rs  úList[pa.Field]rö  r—  r£  r—  )rù  rØ  rú  rØ  r£  rØ  )rþ  r–  r£  úOptional[pa.DataType])r  rØ  r“  rØ  r£  rØ  )r  r—  r  r—  r£  r—  )NrÈ  rÉ  )r  zUnion[pa.Schema, LanceModel]r[  rÂ   r\  rÐ   r¦  )re  rÞ  r  rò  r;  rè  r£  rÞ  )r8  ro   r9  ro   r£  ro   )rÈ  rÉ  NN)re  rÞ  r[  z(Literal['error', 'drop', 'fill', 'null']r\  rÐ   r]  rò  r;  rè  r£  rÞ  )r  r§  r]  rò  r;  rè  r£  ú
List[dict])r  r§  r  r™  r£  r§  )r  rØ  r%  rô   r£  r–  )rë   rÔ  rz  ro   r[  ro   r\  rÐ   rú  rÌ   rû  r˜  r£  rÔ  )r0  ú Union[pa.Array, pa.ChunkedArray]rÿ  rÉ   r\  rÐ   r£  r•  )r0  ú$Union[pa.ListArray, pa.ChunkedArray]r£  zpa.BooleanArray)rG  rè  r£  rô   )rñ  ro   r£  rÎ   )re  rÞ  r£  z&Tuple[pa.Schema, pa.RecordBatchReader])r0  r›  r£  rÌ   )r0  rš  r£  rÌ   )r  r§  )r;  rô   )ïÚ
__future__r   rŸ  r  rå  r  rˆ   Úabcr   r   Údataclassesr   r   r   Ú	functoolsr	   Útypingr
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Úurllib.parser   Úlancedb.scannabler   r   r   r’   r   Ú_blobr   r    r!   r"   r#   r$   r{  r%   Úlancedb.arrowr&   Úlancedb.background_loopr'   r(   Úlancedb.jobr)   r*   r+   Údependenciesr,   r-   r.   r/   r0   r  r1   rb  Úpyarrowr  Úpyarrow.datasetÚpyarrow.computeÚcomputer¯  Ú
pyarrow.fsr’  r�  Únumpyr  Úcommonr2   r3   r4   Ú
embeddingsr5   r6   rì  r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   ÚexprrC   r+  rD   rE   r
  r-  rF   ÚpydanticrG   rH   r4  rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   ÚutilrX   rY   rZ   r[   r\   r]   r^   r  r_   r`   ra   rb   ri   rv   r{   r~   r£   r¬   r�   r™   r¤   r®   r  r¯   Ú_lancedbr°   rã  r±   r²   r³   r´   rµ   r¶   r·   r¸   r¹   rº   r»   r¼   r½   r¾   r¿   rÀ   ÚPILrÁ   rÂ   rÃ   rÄ   rÅ   rÆ   rµ  rÈ   ru  rþ   r%  rI  rC  rf  rd  ry  ru  rk  r�  r¢  r�  rž  rœ  r¹  rÀ  rÐ  rÔ  r×  rÜ  rã  rç  r9  rp  rû  rÿ  rõ  rr  r  r2  r5  r^  r;  r5  rB  r  r_  r  r  r  rý  r#  r  r  rb  rK  r`  rQ  rü  rc  rb  r  r/  rÂ  r>  rC  r©  rD  r&  r(  re   rj   rh   ú<module>rµ     sÔ  ðõ #ã Û Û Û Û ß #Ý !ß (Ý %÷÷ ÷ ÷ ñ õ" "ç VÑ Vå ÷÷ õ Ý %ß <ß 1Ñ 1÷÷ ó Û Ý Ý Û ç 1Ñ 1ß J÷÷ ÷ ó õ ÷õ +ß /÷÷ ÷ ÷ ñ ÷"÷ õ  ÷ó ðPØ#ðPØ:=ðPà	óPðQð ó?ó(ð
 $8Ð  ð"Ð ðØ+ðØ6:ðàóó8"óð QUñØðØ14ðØ@Mðà	óñ4 Ý%÷÷ ÷ ÷ õ õ& #ÛÛ÷÷ ð ØØ	Ø	Ø	ØØ
Ø
Ø	Ø
ØØØð	ñ€ô QF˜	¨õ QFòj 3€óGó@EðR )-ðT
Ø%ðT
àóT
ðp 37ð<Ø
ð<Ø/ð<àó<ðF *.Ø#Ø'.ØðCð "ñCØ
ðCà&ðCð ðCð %ð	Cð
 ðCð ðCð óCðR "ð%FØ ð%Fàð%Fð ð%Fð ó	%FðP@Øð@Ø1:ð@àó@ó#ðLØðØ*3ðàóó@+ð\IØðIØ*2ðIàóIóDó4óóóóóHñ �$Ô÷4ð 4ó ð4óð*Øðà&óóóBð4Øðà!ðð óó Jó	óhQðV%Øð%à$ð%ð ó%ðV Ø'.Øð*à(ð*ð %ð	*ð
 ó*óZòð$ #'ð><ð  $ñ	><Ø ð><àð><ð ð	><ð
 ó><óB0ó 1òôwNˆCô wNôt=YO�ô YOð|: @GØØ)-Ø#ð/CØ ð/Cà<ð/Cð ð/Cð 'ð	/Cð
 ð/Cð ó/CðdCØðCà&ðCð ðCð ó	CðL>Øð>àð>ð ó>ó ð0 "ØØ"&Ø15ðiBØ
ðiBàðiBð ðiBð ð	iBð
  ðiBð /ðiBð óiBðX!Ø	)ð!à	ð!ð ð!ð ó	!ó6.ó4óó?ð<Ø ð<à+ó<ó~$ó/ó,ó"÷&P"Kñ P"KðfD ÷'"ð '"ó ð'"ðT ÷'ð 'ó ð'ð@ ÷"ð "ó ð"ð( ÷ð ó ð÷>B8ñ B8÷JPFñ PF÷fB4ñ B4÷J?Lò ?Lrj   