Λ
    θΛh!  γ                  σ¦    d Z ddlmZ ddlZddlmZ ddlmZ  ej                  e	«      5  ddl
mZ ddd«       erddlmZ ddZy# 1 sw Y   xY w)	z~
Module containing the `len` function.

Keep this function in its own module to avoid conflicts with Python's built-in `len`.
ι    )ΪannotationsN)ΪTYPE_CHECKING)Ϊ	wrap_expr)ΪExprc                 σ<    t        t        j                  «       «      S )u8  
    Return the number of rows in the context.

    This is similar to `COUNT(*)` in SQL.

    Returns
    -------
    Expr
        Expression of data type :class:`UInt32`.

    Examples
    --------
    >>> df = pl.DataFrame(
    ...     {
    ...         "a": [1, 2, None],
    ...         "b": [3, None, None],
    ...         "c": ["foo", "bar", "foo"],
    ...     }
    ... )
    >>> df.select(pl.len())
    shape: (1, 1)
    βββββββ
    β len β
    β --- β
    β u32 β
    βββββββ‘
    β 3   β
    βββββββ

    Generate an index column by using `len` in conjunction with :func:`int_range`.

    >>> df.select(
    ...     pl.int_range(pl.len(), dtype=pl.UInt32).alias("index"),
    ...     pl.all(),
    ... )
    shape: (3, 4)
    βββββββββ¬βββββββ¬βββββββ¬ββββββ
    β index β a    β b    β c   β
    β ---   β ---  β ---  β --- β
    β u32   β i64  β i64  β str β
    βββββββββͺβββββββͺβββββββͺββββββ‘
    β 0     β 1    β 3    β foo β
    β 1     β 2    β null β bar β
    β 2     β null β null β foo β
    βββββββββ΄βββββββ΄βββββββ΄ββββββ
    )r   ΪplrΪlen© σ    ϊp/var/www/html/wine-match-dev/backend/winematch-backend/venv/lib/python3.12/site-packages/polars/functions/len.pyr	   r	      s    τ^ SWWYΣΠr   )Ϊreturnr   )Ϊ__doc__Ϊ
__future__r   Ϊ
contextlibΪtypingr   Ϊpolars._utils.wrapr   ΪsuppressΪImportErrorΪpolars.polarsΪpolarsr   r   r	   r
   r   r   ϊ<module>r      sM   πρυ #γ έ  ε (ΰZΧΡΣ%ρ  έχ ρ έτ/ χ π  ϊs   «AΑA