
    ˀh                    v   d dl mZ d dlmZ d dl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 d d	lmZ d d
lmZmZ er.d dlZd dlmZ d dlmZmZ ej:                  dk\  rd dlmZ nd dlmZ  ed      	 ddd edd	 	 	 	 	 	 	 	 	 	 	 dd       Z  ed      	 dddd ddd	 	 	 	 	 	 	 	 	 	 	 	 	 dd       Z!y)    )annotations)Sequence)TYPE_CHECKINGAnyN)InvalidArgument)
deprecated)is_polars_dtype)
_COL_LIMITcolumn)lists)_instantiate_dtypedtypes)SearchStrategy)OneOrMoreDataTypesPolarsDataType)      zX`columns` is deprecated; use `column` instead, in conjunction with a list comprehension.F)dtypemin_colsmax_colsuniquec          	        | %t        j                  ||      j                         } t        | t              rt        |       D cg c]  }d| 	 }}n| }t        |      }|dg|z  }nYt        |      r|g|z  }nGt        |t              r't        |      x}	|k7  rd|	 d| d}
t        |
      |}n|d}
t        |
      t        ||      D cg c]  \  }}t        |||       c}}S c c}w c c}}w )	aG  
    Define multiple columns for use with the @dataframes strategy.

    .. deprecated:: 0.20.26
        Use :class:`column` instead, in conjunction with a list comprehension.

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

    Generate a fixed sequence of `column` objects suitable for passing to the
    @dataframes strategy, or using standalone (note that this function is not itself
    a strategy).

    Notes
    -----
    Additional control is available by creating a sequence of columns explicitly,
    using the `column` class (an especially useful option is to override the default
    data-generating strategy for a given col/dtype).

    Parameters
    ----------
    cols : {int, [str]}, optional
        integer number of cols to create, or explicit list of column names. if
        omitted a random number of columns (between mincol and max_cols) are
        created.
    dtype : PolarsDataType, optional
        a single dtype for all cols, or list of dtypes (the same length as `cols`).
        if omitted, each generated column is assigned a random dtype.
    min_cols : int, optional
        if not passing an exact size, can set a minimum here (defaults to 0).
    max_cols : int, optional
        if not passing an exact size, can set a maximum value here (defaults to
        MAX_COLS).
    unique : bool, optional
        indicate if the values generated for these columns should be unique
        (per-column).

    Examples
    --------
    >>> from polars.testing.parametric import columns, dataframes
    >>> from hypothesis import given
    >>> @given(dataframes(columns(["x", "y", "z"], unique=True)))  # doctest: +SKIP
    ... def test_unique_xyz(df: pl.DataFrame) -> None:
    ...     assert_something(df)
    N)	min_value	max_valuecolzgiven z dtypes for z namesz is not a valid polars datatype)namer   r   )stintegersexample
isinstanceintrangelenr	   r   r   zipr   )colsr   r   r   r   nnamesn_colsr   n_dtypesmsgnmtps                /var/www/html/wine-match-dev/backend/winematch-backend/venv/lib/python3.12/site-packages/polars/testing/parametric/strategies/legacy.pycolumnsr.      s   v |{{XBJJL$38;?a#aS	??ZF}37&6/		6!	E8	$E
"Hv-8*L?C!#&&	89c"" DGufCUVRF"V4VV'  @& Ws   C.C3z:`create_list_strategy` is deprecated; use `lists` instead.)select_fromsizemin_sizemax_sizer   c                   ||x}}| t               j                         } nt        |       j                         } t        | ||||      S )a  
    Create a strategy for generating Polars :class:`List` data.

    .. deprecated:: 0.20.26
        Use :func:`lists` instead.

    Parameters
    ----------
    inner_dtype : PolarsDataType
        type of the inner list elements (can also be another List).
    select_from : list, optional
        randomly select the innermost values from this list (otherwise
        the default strategy associated with the innermost dtype is used).
    size : int, optional
        if set, generated lists will be of exactly this size (and
        ignore the min_size/max_size params).
    min_size : int, optional
        set the minimum size of the generated lists (default: 0 if unset).
    max_size : int, optional
        set the maximum size of the generated lists (default: 3 if
        min_size is unset or zero, otherwise 2x min_size).
    unique : bool, optional
        ensure that the generated lists contain unique values.

    Examples
    --------
    Create a strategy that generates a list of i32 values:

    >>> from polars.testing.parametric import create_list_strategy
    >>> lst = create_list_strategy(inner_dtype=pl.Int32)  # doctest: +SKIP
    >>> lst.example()  # doctest: +SKIP
    [-11330, 24030, 116]
    )r/   r1   r2   r   )r   r   r   r   )inner_dtyper/   r0   r1   r2   r   s         r-   create_list_strategyr5   p   sZ    V ""8h&&((5==?     )N)r%   zint | Sequence[str] | Noner   zOneOrMoreDataTypes | Noner   r!   r   r!   r   boolreturnzlist[column])r4   zPolarsDataType | Noner/   zSequence[Any] | Noner0   
int | Noner1   r!   r2   r9   r   r7   r8   zSearchStrategy[list[Any]])"
__future__r   collections.abcr   typingr   r   hypothesis.strategies
strategiesr   hypothesis.errorsr   polars._utils.deprecationr   polars.datatypesr	   )polars.testing.parametric.strategies.corer
   r   )polars.testing.parametric.strategies.datar   *polars.testing.parametric.strategies.dtyper   r   sysr   polars._typingr   r   version_infowarningstyping_extensionsr.   r5    r6   r-   <module>rK      s>   " $ % " - 0 , H ; Q4A
7"'0 0
 (,MW (,MW
$MW %MW 	MW
 MW MW MW	MW` HI)-8 )-8&8 &8 	8
 8 8 8 8 J8r6   