
    .h8                       U d dl mZ d dlmZ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mZmZmZ erd dlZd dlZd dlmZmZ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$ d dl%m&Z' d dl%m(Z) d dl%m*Z+ d dl%m,Z, d dl-m.Z.m/Z/m0Z0m1Z1 d dl2m3Z3 d dl4m5Z5  ejl                  e7      5  d dl8m9Z9 ddd       ejt                  dk\  rd dl	m;Z; nd dl<m;Z;  G d de      Z= G d de      Z> G d de      Z?ed   Z@deAd<   eeBd   df   ZCdeAd<   eeBd    d f   ZDdeAd!<   ee@ee@   f   ZEdeAd"<   eeBeF   eBeG   eBeH   eBeI   eBd#   eBd$   eBd%   eBd&   eBeJe      eBeKed'f      eBeL   eBeM   eBd(   eBd   f   ZNdeAd)<   eeeIee@eNdf   f   eeeIeKeIee@eNdf   f   f      f   ZOdeAd*<   eeIe@f   ZPdeAd+<   eeFeGd(f   ZQdeAd,<   ed-   ZRdeAd.<   eeQeReIeHeLf   ZSdeAd/<   eeSd0eJe   f   ZTdeAd1<   ed2d3eIf   ZUdeAd4<   eeTeUdf   ZVdeAd5<   ed6   ZWdeAd7<   d8ZXdeAd9<   eeIeXf   ZYdeAd:<   ed;   ZZdeAd<<   ed=   Z[deAd><   ed?   Z\deAd@<   edA   Z]deAdB<   edC   Z^deAdD<   eKedE   dFf   Z_deAdG<   eKedH   e`eFed3eIf   f   f   ZadeAdI<   eKedJ   e`eFeJeI   f   f   ZbdeAdK<   edL   ZcdeAdM<   edN   ZddeAdO<   edP   ZedeAdQ<   edR   ZfdeAdS<   edT   ZgdeAdU<   edV   ZhdeAdW<   edX   ZideAdY<   edZ   ZjdeAd[<   ed\   ZkdeAd]<   ed^   ZldeAd_<   ed`   ZmdeAda<   edb   ZndeAdc<   edd   ZodeAde<   edf   ZpdeAdg<   edh   ZqdeAdi<   edj   ZrdeAdk<   edl   ZsdeAdm<   edn   ZtdeAdo<   edp   ZudeAdq<   edr   ZvdeAds<   edt   ZwdeAdu<   edv   ZxdeAdw<   edx   ZydeAdy<   edz   ZzdeAd{<   ed|   Z{deAd}<   ed~   Z|deAd<   ed   Z}deAd<   ed   Z~deAd<   ed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   ed   Zed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   ed   Zed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   ed   ZdeAd<   eeeIeeeM   eeIeeM   f   d3f   f   ee   d0dddddf   ZdeAd<   eeeYeKeYd'f   f   eeIeeIeIf   f   f   ZdeAd<   eeeYeeI   f   eeIeeeIef   eeeIeeIef   f      f   f   f   ZdeAd<   eeeeYeKeY   f   eIf   eeI   eHf   ZdeAd<   eeeYeeKeId'f   eFf   f   eFf   ZdeAd<   eeeIeeIeeI   f   f   eeI   eHf   ZdeAd<   ed   ZdeAd<    edddd3d2      Z eddd      ZeKeFeFeFf   ZdeAd<   ed   ZdeAd<    G d de      Z G d de      Z G d de      Z G d de      Zed   ZdeAd<   eeeeef   ZdeAd<   eFZdeAd<   eeeeeF   d3d0f   ZdeAd<   eIZdeAd<   eeeeI   d3d0f   ZdeAd<   eeeH   d3d0f   ZdeAd<   eeef   ZdeAd<   eeeef   ZdeAd<   eed   df   ZdeAd<   ed   ZdeAd<   eeIee
eL   eLeJeI   eJe   eJe
eL      eJeL   f   ZdeAd<   eeegeLf   eegeIf   f   Zed   ZdeAd<    G d΄ dϫ      Zg dТZ G dф dҫ      Zeege`eIeIf   f   ZdeAd<   ee`eIeIf   ef   ZdeAd<   y# 1 sw Y   xY w)    )annotations)
CollectionIterableMappingSequence)Path)	IOTYPE_CHECKINGAnyCallableLiteralProtocol	TypedDictTypeVarUnionN)datedatetimetime	timedelta)Decimal)
ConnectionEngine)Session)	DataFrameExpr	LazyFrameSeries)numpy)pandas)pyarrow)torch)DataTypeDataTypeClassIntegerTypeTemporalType)	GPUEngine)Selector)PyPartitioning)   
   )	TypeAliasc                  "    e Zd ZdZ	 d	 	 	 ddZy)ArrowArrayExportablezGType protocol for Arrow C Data Interface via Arrow PyCapsule Interface.Nc                     y N selfrequested_schemas     L/var/www/html/ai-service/venv/lib/python3.12/site-packages/polars/_typing.py__arrow_c_array__z&ArrowArrayExportable.__arrow_c_array__/   s     #    r/   )r3   object | Nonereturnztuple[object, object])__name__
__module____qualname____doc__r5   r0   r6   r4   r-   r-   ,   s    Q 15$ -$	$r6   r-   c                      e Zd ZdZdddZy)ArrowStreamExportablezIType protocol for Arrow C Stream Interface via Arrow PyCapsule Interface.Nc                     y r/   r0   r1   s     r4   __arrow_c_stream__z(ArrowStreamExportable.__arrow_c_stream__7       r6   r/   )r3   r7   r8   object)r9   r:   r;   r<   r@   r0   r6   r4   r>   r>   4   s    SWr6   r>   c                      e Zd ZdZddZy)ArrowSchemaExportablezIType protocol for Arrow C Schema Interface via Arrow PyCapsule Interface.c                     y r/   r0   r2   s    r4   __arrow_c_schema__z(ArrowSchemaExportable.__arrow_c_schema__=   rA   r6   N)r8   rB   )r9   r:   r;   r<   rG   r0   r6   r4   rD   rD   :   s    S/r6   rD   )r#   r"   r+   PolarsDataTyper%   PolarsTemporalTyper$   PolarsIntegerTypeOneOrMoreDataTypesr   r   r   r   .r   PythonDataTypeSchemaDefinition
SchemaDictNumericLiteral)r   r   r   r   TemporalLiteralNonNestedLiteralznp.ndarray[Any, Any]PythonLiteralr   r   IntoExprColumnIntoExpr)eqneqgtltgt_eqlt_eqComparisonOperatorr'   SelectorTypeColumnNameOrSelector)earliestlatestraisenull	Ambiguous)uncompressedsnappydeflateAvroCompression)	necessaryalwaysnon_numericneverCsvQuoteStyle)physicallexicalCategoricalOrdering)utf8z
utf8-lossyCsvEncodingziceberg-column-mappingz	pa.SchemaColumnMappingicebergDefaultFieldValuesziceberg-position-deleteDeletionFiles)forwardbackwardminmaxmeanzerooneFillNullStrategy)fullmixedFloatFmt)cfortran
IndexOrder)rc   lz4zstdIpcCompression)zm:mzm:1z1:mz1:1JoinValidation)leftright	datapointLabel)noner   r   
left_right
right_leftMaintainOrderJoin)r`   ra   NonExistent)ignoredropNullBehavior)autocolumns
row_groupsprefilteredr   ParallelStrategy)r   rc   rd   gziplzobrotlir   ParquetCompression)rw   rx   firstlastsumry   medianlenPivotAgg)nearesthigherlowermidpointlinearequiprobableQuantileMethod)averagerw   rx   denseordinalrandom
RankMethod)r`   ru   rv   Roll)half_to_evenhalf_away_from_zero	RoundMode)binaryjsonSerializationFormat)littlebig
Endianness)
bkbmbgbtbbytes	kilobytes	megabytes	gigabytes	terabytesSizeUnit)	windowr   mondaytuesday	wednesdaythursdayfridaysaturdaysundayStartBy)dataallSyncOnCloseMethod)nsusmsTimeUnit)NFCNFKCNFDNFKDUnicodeForm)r   r   anyr   UniqueKeepStrategy)vertical
horizontalUnstackDirection)thread_local	threadingMapElementsStrategy)rv   ru   r   AsofJoinStrategy)r   r   bothr   ClosedInterval)r   r   InterpolationMethod)innerr   r   r}   semianticrossouterJoinStrategy)first_non_null	max_widthListToStructWidthStrategy)
r   vertical_relaxeddiagonaldiagonal_relaxedr   align
align_fullalign_inner
align_leftalign_right)pearsonspearmanCorrelationMethod)adbc
connectorxDbReadEngine)
sqlalchemyr   DbWriteEngine)replaceappendfailDbWriteMode)r   r   r   sd)arraydictJaxExportType)colrowOrientation)r   r   r   SearchSortedSide)tensordatasetr  TorchExportType)hexbase64TransferEncoding)group_to_rowsjoinexplodeWindowMappingStrategy)plaintreeExplainFormatzpa.Tablezpd.DataFrameztorch.TensorFrameInitTypesColumnFormatDictConditionalFormatDictColumnTotalsDefinitionColumnWidthsDefinitionRowTotalsDefinition)fastbalanced	expensiveParametricProfileNames
PolarsTyper   r   	FrameType
BufferInfo)calamineopenpyxlxlsx2csvExcelSpreadsheetEnginec                  0    e Zd ZU dZded<   ded<   ded<   y)SeriesBufferszUnderlying buffers of a Series.r   valueszSeries | NonevalidityoffsetsN)r9   r:   r;   r<   __annotations__r0   r6   r4   r)  r)    s    )Nr6   r)  c                      e Zd ZddZy)BasicConnectionc                     y)zReturn a cursor object.Nr0   r2   argskwargss      r4   cursorzBasicConnection.cursor  rA   r6   Nr2  r   r3  r   r8   r   )r9   r:   r;   r4  r0   r6   r4   r/  r/    s    &r6   r/  c                      e Zd ZddZy)BasicCursorc                     y)zExecute a query.Nr0   r1  s      r4   executezBasicCursor.execute  rA   r6   Nr5  )r9   r:   r;   r9  r0   r6   r4   r7  r7    s    r6   r7  c                      e Zd ZddZddZy)Cursorc                     y)zFetch all results.Nr0   r1  s      r4   fetchallzCursor.fetchall!  rA   r6   c                     y)zFetch results in batches.Nr0   r1  s      r4   	fetchmanyzCursor.fetchmany$  rA   r6   Nr5  )r9   r:   r;   r=  r?  r0   r6   r4   r;  r;     s    !(r6   r;  )r   r   r   AlchemyConnectionConnectionOrCursorSingleIndexSelectorMultiIndexSelectorSingleNameSelectorMultiNameSelectorBooleanMaskSingleColSelectorMultiColSelector)r   z	in-memory	streaminggpur&   
EngineType)irrl   	PlanStage
FileSource)functionrenamed_parameterstreaming_parameternonkeyword_argumentsparameter_as_multi_positionalDeprecationTypec                  .    e Zd Z	 	 	 	 ddZedd       Zy)PartitioningSchemec                    || _         y r/   )_py_partitioning)r2   py_partitionings     r4   __init__zPartitioningScheme.__init__c  s     !0r6   c                .    | j                   j                  S r/   )rX  	base_pathrF   s    r4   
_base_pathzPartitioningScheme._base_pathi  s    $$...r6   N)rY  r(   r8   None)r8   z
str | None)r9   r:   r;   rZ  propertyr]  r0   r6   r4   rV  rV  b  s-    0'0 
0 / /r6   rV  )\rb   r-   r>   r   rf   rF  r#  rn   r   r  r]   r  r  r[   ConcatMethodr  rA  r   rp   rk   r;  r   r   r   rT  r   rK  EpochTimeUnitr'  r  rN  r|   r   r  r"  r   r   rT   rS   r   JSONEncoderr  r   r   r   r   r   r   rH  rC  rE  r   rQ   r   rO   rK   r  r   r   r   rV  r   rH   rJ   rI   r!  rL   rR   r   r   r   r  rM   rN   r	  r\   r   r)  rG  rB  rD  r   r   r   rP   r   r  r  r   r   r   r  c                  $    e Zd ZU dZddZded<   y)ParquetMetadataContextz
    The context given when writing file-level parquet metadata.

    .. warning::
        This functionality is considered **experimental**. It may be removed or
        changed at any point without it being considered a breaking change.
    arrow_schemastrc                   || _         y r/   )re  )r2   re  s     r4   rZ  zParquetMetadataContext.__init__  s
    (r6   N)re  rf  r8   r^  )r9   r:   r;   r<   rZ  r-  r0   r6   r4   rd  rd    s    ) r6   rd  ParquetMetadataFnParquetMetadata)
__future__r   collections.abcr   r   r   r   pathlibr   typingr	   r
   r   r   r   r   r   r   r   
contextlibsysr   r   r   r   decimalr   sqlalchemy.enginer   r   sqlalchemy.ormr   polarsr   r   r   r   polars._dependenciesr   npr   pdr    par!   polars.datatypesr"   r#   r$   r%   polars.lazyframe.engine_configr&   polars.selectorsr'   suppressImportErrorpolars._plrr(   version_infor+   typing_extensionsr-   r>   rD   rH   r-  typerI   rJ   rK   intfloatboolrf  listtupler   rB   rL   rM   rN   rO   rP   rQ   rR   rS   rT   r[   r\   r]   rb   rf   rk   rn   rp   rq   r  rs   rt   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`  r   r   r   r   ra  r  r  r	  r  r  r  r  r  r  r  r  r  r  r   r!  r"  r#  r'  r)  r/  r7  r;  r@  rA  rB  slicerangerC  rD  rE  rF  rG  rH  rK  rM  rN  rb  rT  rV  __all__rd  rh  ri  r0   r6   r4   <module>r     s
   " C C 
 
 
 884&99012*SS8)			[	) /./ 7"$/$8 $XH X0H 0 ""=>	 > %d>&:N&J K I K$T-%8-%GH 9 H %nh~6N&N O I O!IKJILLcOsCxKLOJ	 " $C~~t;<<=U3c5)M#NNOOPQS )   ^ 34
I 4!#ui"78	 8"#JK K#NOS$PU$UV ) V !13I4PS9!TUy U!&(C"78	 8M>4?@) @ '(Q R I R %i $"'\(9": i : DE	9 E$%HI I"#PQy Q!()>!? Y ? !56Y 6 )A!BK!OPy P %IS%#"6677! I  !%&S$s)^(<<y  &> )  o.) ./
I /#$AB	 B#$>?	 ?78y 8&7  9  !1Y 1!"23i 3%: )  !(D! I  A)  $F	    UV
I V89i 9DE	9 E!()9!: Y :0
I 0	)  
 
  '}5 9 5./) / !=>Y > '(F G I G%&>? ) ?!()D!E Y E &&FG ) G#$CD	 D!()<!= Y =!Fi  (//L'M 9 M 	  ''<= 9 =!"67i 7"#78y 8 !<=Y =23"?3y 3 .Y .%&<= ) =$%@A A%o6 ) 6#*+M#N y N"?3y 3 "Cx'hv6F1F)GQRRSSM		 	 &	
&:C&? @
@A	#wsCx 
 !# ) 
 $+	

3
/0	#uWS#X&sGCH<M7M1N(OOP
PQS$ y 
 %*E&.B(CCDcIJSM
% 	  %* %c3h(<"==>C% 	  "'CsJsO+,,-sO
" Y  %,,K$L 	 L \;XvN
Kk:	c3m,
I , %,,N$O 	 OI &h &
( 
([ (  %%FG 9 G %[&*;;! I 
 "% Y $ %		SM	! I  !$ I #$	SM  9  TNY 
  %%8:L%LM 9 M#$68I;$VW ) W 34kA
I  /0	9 0uI	IJEOK	
I 	 HcUE\*HcUCZ,@@A$% 	/ 	/]@   ()?(@$sCx.(PQ 9 Q"4S>3D#DE Ew/ /s   (Y22Y<