
    h                        % S SK Jr  S SKJrJr  S SKJr  \(       a  S SKJr  S SK	J
r
  \S   rS\S'   \S	   rS\S
'   SqS\S'    " S S5      rg)    )annotations)TYPE_CHECKINGLiteral)issue_unstable_warning)
Collection)	TypeAlias)upcastdowncastr   FloatCastOption)nanosecond-downcastconvert-timezoneDatetimeCastOptionNzScanCastOptions | None_DEFAULT_CAST_OPTIONS_ICEBERGc                  |    \ rS rSrSrSSSSSSSS.               SS jjr\SS j5       r\SS	 j5       r	S
r
g)ScanCastOptions   zOptions for scanning files.forbidraiseFinteger_cast
float_castdatetime_castmissing_struct_fieldsextra_struct_fieldscategorical_to_string_internal_callc               p    U(       d  [        S5        Xl        X l        X0l        X@l        XPl        X`l        g)a  
Common configuration for scanning files.

.. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.

Parameters
----------
integer_cast
    Configuration for casting from integer types:

    * `upcast`: Allow lossless casting to wider integer types.
    * `forbid`: Raises an error if dtypes do not match.

float_cast
    Configuration for casting from float types:

    * `upcast`: Allow casting to higher precision float types.
    * `downcast`: Allow casting to lower precision float types.
    * `forbid`: Raises an error if dtypes do not match.

datetime_cast
    Configuration for casting from datetime types:

    * `nanosecond-downcast`: Allow nanosecond precision datetime to be             downcasted to any lower precision. This has a similar effect to             PyArrow's `coerce_int96_timestamp_unit`.
    * `convert-timezone`: Allow casting to a different timezone.
    * `forbid`: Raises an error if dtypes do not match.

missing_struct_fields
    Configuration for behavior when struct fields defined in the schema
    are missing from the data:

    * `insert`: Inserts the missing fields.
    * `raise`: Raises an error.

extra_struct_fields
    Configuration for behavior when extra struct fields outside of the
    defined schema are encountered in the data:

    * `ignore`: Silently ignores.
    * `raise`: Raises an error.

categorical_to_string
    Configuration for behavior when reading in a column whose expected
    type is string, but type in the file is categorical.

    * `allow`: Categorical is casted to string.
    * `forbid`: Raises an error.

z'ScanCastOptions is considered unstable.N)r   r   r   r   r   r   r   )selfr   r   r   r   r   r   r   s           ]/home/james-whalen/.local/lib/python3.13/site-packages/polars/io/scan_options/cast_options.py__init__ScanCastOptions.__init__   s4    H "#LM($*%:"#6 %:"    c                     [        SS9$ )NT)r   )r    r"   r   _defaultScanCastOptions._defaulte   s    d33r"   c           
     B    [         c  [        SSS/SS/SSSSS	9q [         $ )
z
Default options suitable for Iceberg / Deltalake.

This in general has all casting options enabled. Note: do not modify the
returned config object, it is a cached global object.
r	   r
   r   r   insertignoreallowTr   )r   r   )clss    r   _default_iceberg ScanCastOptions._default_icebergi   s=     )0,;%$j146HI&.$,&-#-) -,r"   )r   r   r   r   r   r   N)r   zLiteral['upcast', 'forbid']r   zALiteral['forbid'] | FloatCastOption | Collection[FloatCastOption]r   zGLiteral['forbid'] | DatetimeCastOption | Collection[DatetimeCastOption]r   zLiteral['insert', 'raise']r   zLiteral['ignore', 'raise']r   zLiteral['allow', 'forbid']r   boolreturnNone)r/   r   )__name__
__module____qualname____firstlineno____doc__r    staticmethodr%   classmethodr,   __static_attributes__r$   r"   r   r   r      s    %
 5= )1 ,4<C:A<D$L; 2L;&	L;)L;  :L; 8L;  :L; L; 
L;^ 4 4 - -r"   r   )
__future__r   typingr   r   polars._utils.unstabler   collections.abcr   typing_extensionsr   r   __annotations__r   r   r   r$   r"   r   <module>r?      sR    " ) 9*+ %%9: : '(Q R I R8< 5 <k- k-r"   