
    q-Ph                     n    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 erd dlmZmZ dddddZddZdS )    )annotations)partial)TYPE_CHECKINGNpyarrow)	DataFrame	LazyFrameT)allow_pyarrow_filter
batch_sizedspa.dataset.Datasetr
   boolr   
int | Nonereturnr	   c               ~    t          t          | |          }t          j                            | j        ||          S )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)r   r
   r   funcs       h/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/polars/io/pyarrow_dataset/anonymous_scan.py_scan_pyarrow_datasetr      sB    . -rjIIID<--
	4!5 .       with_columnslist[str] | None	predicate
str | Nonen_rowsr   c                    ddl m} d}|r4ddlm}m}m}	m}
 ddlm}m	}m
} t          |t          ||||||	|
d          }||d}|||d<   |r | | j        |fi |          S  | | j        d	i |          S )
a  
    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.

    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   r   r   r   r   r    _filterr!   r"   r#   r$   r%   r&   r'   common_paramss                  r   r   r   *   s    6 "!!!!!G 
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	>=========$$("0(#2	 	
 
 !-@@M&0l# <z'"'&::M::;;;:kbk22M22333r   )r   r   r
   r   r   r   r   r	   )r   r   r   r   r   r   r   r   r   r   r   r   )
__future__r   	functoolsr   typingr   polars._reexport	_reexportr   polars.dependenciesr   r(   r,   r   r	   r   r   r+   r   r   <module>r:      s    " " " " " "                         - - - - - - ,++++++++ "&!	     :=4 =4 =4 =4 =4 =4r   