
    h                        S SK Jr  S SKJr  S SKJr  S SKJr  S SK	J
r  \(       a  S SKJrJr  SSS.       SS	 jjr            SS
 jrg)    )annotations)partial)TYPE_CHECKINGNpyarrow)	DataFrame	LazyFrameT)allow_pyarrow_filter
batch_sizec               n    [        [        XS9n[        R                  R	                  U R
                  X1S9$ )a  
Pickle the partially applied function `_scan_pyarrow_dataset_impl`.

The bytes are then sent to the polars logical plan. It can be deserialized once
executed and ran.

Parameters
----------
ds
    pyarrow dataset
allow_pyarrow_filter
    Allow predicates to be pushed down to pyarrow. This can lead to different
    results if comparisons are done with null values as pyarrow handles this
    different than polars does.
batch_size
    The maximum row count for scanned pyarrow record batches.
)r   r   )r   _scan_pyarrow_dataset_implplr	   _scan_python_functionschema)dsr
   r   funcs       b/home/james-whalen/.local/lib/python3.13/site-packages/polars/io/pyarrow_dataset/anonymous_scan.py_scan_pyarrow_datasetr      s6    . -rID<<--
		4 .      c                   SSK Jn  SnU(       a/  SSKJnJnJn	Jn
  SSKJnJ	nJ
n  [        U[        UUUUUU	U
S.5      nXS.nUb  XNS'   U(       a  U" U R                  " U40 UD65      $ U" U R                  " S	0 UD65      $ )
a0  
Take the projected columns and materialize an arrow table.

Parameters
----------
ds
    pyarrow dataset
with_columns
    Columns that are projected
predicate
    pyarrow expression that can be evaluated with eval
n_rows:
    Materialize only n rows from the arrow dataset
batch_size
    The maximum row count for scanned pyarrow record batches.

Warnings
--------
Don't use this if you accept untrusted user inputs. Predicates will be evaluated
with python 'eval'. There is sanitation in place, but it is a possible attack
vector.

Returns
-------
DataFrame
r   )
from_arrowN)
to_py_dateto_py_datetime
to_py_timeto_py_timedelta)DateDatetimeDuration)par   r   r   r   r   r   r   )columnsfilterr    )polarsr   polars._utils.convertr   r   r   r   polars.datatypesr   r   r   evalr   headto_table)r   with_columns	predicaten_rowsr   r   _filterr   r   r   r   r   r   r   common_paramss                  r   r   r   *   s    B "G	
 	
 	>=$$("0(#2	
 !-@M&0l#"''&:M:;;bkk2M233r   )r   pa.dataset.Datasetr
   boolr   
int | Nonereturnr	   )r   r.   r)   zlist[str] | Noner*   z
str | Noner+   r0   r   r0   r1   r   )
__future__r   	functoolsr   typingr   polars._reexport	_reexportr   polars._dependenciesr   r   r#   r   r	   r   r   r"   r   r   <module>r8      s    "     .+ "&!	  	
 :C4C4"C4 C4 	C4
 C4 C4r   