
    ˀhO                        U d dl mZ d dlmZmZ d dlmZ erd dlmZ d dl	m
Z
 ed   Zded<   ed	   Zded
<    G d d      Zy)    )annotations)TYPE_CHECKINGLiteral)issue_unstable_warning)
Collection)	TypeAlias)upcastdowncastr   FloatCastOption)znanosecond-downcastzconvert-timezoneDatetimeCastOptionc                  T    e Zd ZdZddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 d	dZed
d       Zy)ScanCastOptionszOptions for scanning files.forbidraiseF)integer_cast
float_castdatetime_castmissing_struct_fieldsextra_struct_fields_internal_callc               d    |st        d       || _        || _        || _        || _        || _        y)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.

        z'ScanCastOptions is considered unstable.N)r   r   r   r   r   r   )selfr   r   r   r   r   r   s          /var/www/html/wine-match-dev/backend/winematch-backend/venv/lib/python3.12/site-packages/polars/io/scan_options/cast_options.py__init__zScanCastOptions.__init__   s8    x "#LM($*%:"#6     c                     t        d      S )NT)r   )r    r   r   _defaultzScanCastOptions._defaultY   s    d33r   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   boolreturnNone)r    r   )__name__
__module____qualname____doc__r   staticmethodr   r   r   r   r   r      s    %
 5= )1 ,4<C:A$C7 2C7&	C7)C7  :C7 8C7 C7 
C7J 4 4r   r   N)
__future__r   typingr   r   polars._utils.unstabler   collections.abcr   typing_extensionsr   r   __annotations__r   r   r   r   r   <module>r-      sF    " ) 9*+ %%9: : '(Q R I RJ4 J4r   