
    q-Ph                        d dl mZ d dl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  ej        e          5  d dlmZ ddd           n# 1 swxY w Y   erd d	lmZ ddd
ddZdS )    )annotationsN)Path)IOTYPE_CHECKING)normalize_filepath)wrap_df)parse_columns_arg)PyDataFrame)	DataFrame)columnsn_rowssourcestr | Path | IO[bytes] | bytesr   list[int] | list[str] | Noner   
int | Nonereturnr   c                   t          | t          t          f          rt          |           } t	          |          \  }}t          j        | |||          }t          |          S )a  
    Read into a DataFrame from Apache Avro format.

    Parameters
    ----------
    source
        Path to a file or a file-like object (by "file-like object" we refer to objects
        that have a `read()` method, such as a file handler like the builtin `open`
        function, or a `BytesIO` instance). For file-like objects, the stream position
        may not be updated accordingly after reading.
    columns
        Columns to select. Accepts a list of column indices (starting at zero) or a list
        of column names.
    n_rows
        Stop reading from Apache Avro file after reading `n_rows`.

    Returns
    -------
    DataFrame
    )
isinstancestrr   r   r	   r
   	read_avror   )r   r   r   
projectioncolumn_namespydfs         N/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/polars/io/avro.pyr   r      s[    4 &3+&& ,#F++099J z6JJD4==    )r   r   r   r   r   r   r   r   )
__future__r   
contextlibpathlibr   typingr   r   polars._utils.variousr   polars._utils.wrapr   polars.io._utilsr	   suppressImportErrorpolars.polarsr
   polarsr   r    r   r   <module>r(      sI   " " " " " "           $ $ $ $ $ $ $ $ 4 4 4 4 4 4 & & & & & & . . . . . .Z%% * *))))))* * * * * * * * * * * * * * *  !       -1	       s   AAA