
    j              
      ~   d dl mZ d dlZd dlmZ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  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lmZ d dlmZ d dlmZ d dlmZ  e            dddd dddddd)d&            Z e            dddd dddddd*d(            Z dS )+    )annotationsN)IOTYPE_CHECKINGLiteral)unstable)wrap_ldf)get_sources)!_init_credential_provider_builder)ScanOptions)PyLazyFrame)Path)StorageOptionsDict)	DataFrame)CredentialProviderFunction)	LazyFramelineTautonamen_rowsrow_index_namerow_index_offsetglobstorage_optionscredential_providerinclude_file_pathssourcecstr | Path | IO[str] | IO[bytes] | bytes | list[str] | list[Path] | list[IO[str]] | list[IO[bytes]]r   strr   
int | Noner   
str | Noner   intr   boolr   StorageOptionsDict | Noner   3CredentialProviderFunction | Literal['auto'] | Noner   returnr   c               V    t          | ||||||||	  	                                        S )uh	  
    Read lines into a string column from a file.

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

    Parameters
    ----------
    source
        Path(s) to a file or directory
        When needing to authenticate for scanning cloud locations, see the
        `storage_options` parameter.
    name
        Name to use for the output column.
    n_rows
        Stop reading from parquet file after reading `n_rows`.
    row_index_name
        If not None, this will insert a row index column with the given name into the
        DataFrame
    row_index_offset
        Offset to start the row index column (only used if the name is set)
    glob
        Expand path given via globbing rules.
    storage_options
        Options that indicate how to connect to a cloud provider.

        The cloud providers currently supported are AWS, GCP, and Azure.
        See supported keys here:

        * `aws <https://docs.rs/object_store/latest/object_store/aws/enum.AmazonS3ConfigKey.html>`_
        * `gcp <https://docs.rs/object_store/latest/object_store/gcp/enum.GoogleConfigKey.html>`_
        * `azure <https://docs.rs/object_store/latest/object_store/azure/enum.AzureConfigKey.html>`_
        * Hugging Face (`hf://`): Accepts an API key under the `token` parameter: \
          `{'token': '...'}`, or by setting the `HF_TOKEN` environment variable.

        If `storage_options` is not provided, Polars will try to infer the information
        from environment variables.
    credential_provider
        Provide a function that can be called to provide cloud storage
        credentials. The function is expected to return a dictionary of
        credential keys along with an optional credential expiry time.

        .. warning::
            This functionality is considered **unstable**. It may be changed
            at any point without it being considered a breaking change.
    include_file_paths
        Include the path of the source file(s) as a column with this name.

    See Also
    --------
    scan_lines

    Examples
    --------
    >>> pl.read_lines(b"Hello\nworld")
    shape: (2, 1)
    ┌───────┐
    │ line  │
    │ ---   │
    │ str   │
    ╞═══════╡
    │ Hello │
    │ world │
    └───────┘
    r   )
scan_linescollect)	r   r   r   r   r   r   r   r   r   s	            T/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/polars/io/lines.py
read_linesr+      sB    r %)'/-
 
 
 gii
    r   c                   t          |           }	t          ||	|d          }
~t          j        |	t	          |||fnd|d|fnd||||
          |          }t          |          S )u	  
    Construct a LazyFrame which scans lines into a string column from a file.

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

    Parameters
    ----------
    source
        Path(s) to a file or directory
        When needing to authenticate for scanning cloud locations, see the
        `storage_options` parameter.
    name
        Name to use for the output column.
    n_rows
        Stop reading from parquet file after reading `n_rows`.
    row_index_name
        If not None, this will insert a row index column with the given name into the
        DataFrame
    row_index_offset
        Offset to start the row index column (only used if the name is set)
    glob
        Expand path given via globbing rules.
    storage_options
        Options that indicate how to connect to a cloud provider.

        The cloud providers currently supported are AWS, GCP, and Azure.
        See supported keys here:

        * `aws <https://docs.rs/object_store/latest/object_store/aws/enum.AmazonS3ConfigKey.html>`_
        * `gcp <https://docs.rs/object_store/latest/object_store/gcp/enum.GoogleConfigKey.html>`_
        * `azure <https://docs.rs/object_store/latest/object_store/azure/enum.AzureConfigKey.html>`_
        * Hugging Face (`hf://`): Accepts an API key under the `token` parameter: \
          `{'token': '...'}`, or by setting the `HF_TOKEN` environment variable.

        If `storage_options` is not provided, Polars will try to infer the information
        from environment variables.
    credential_provider
        Provide a function that can be called to provide cloud storage
        credentials. The function is expected to return a dictionary of
        credential keys along with an optional credential expiry time.

        .. warning::
            This functionality is considered **unstable**. It may be changed
            at any point without it being considered a breaking change.
    include_file_paths
        Include the path of the source file(s) as a column with this name.

    See Also
    --------
    read_lines

    Examples
    --------
    >>> pl.scan_lines(b"Hello\nworld").collect()
    shape: (2, 1)
    ┌───────┐
    │ line  │
    │ ---   │
    │ str   │
    ╞═══════╡
    │ Hello │
    │ world │
    └───────┘
    r(   Nr   )	row_index	pre_slicer   r   r   r   )sourcesscan_optionsr   )r	   r
   r   new_from_scan_linesr   r   )r   r   r   r   r   r   r   r   r   r0   credential_provider_builderpylfs               r*   r(   r(      s    r &!!G"CWo|# # 	*  "-  !122%+%7q&kkT1+ ;
 
 
   D" D>>r,   )r   r   r   r   r   r    r   r!   r   r"   r   r#   r   r$   r   r%   r   r!   r&   r   )r   r   r   r   r   r    r   r!   r   r"   r   r#   r   r$   r   r%   r   r!   r&   r   )!
__future__r   
contextlibtypingr   r   r   polars._utils.unstabler   polars._utils.wrapr   polars.io._utilsr	   ,polars.io.cloud.credential_provider._builderr
   polars.io.scan_options._optionsr   suppressImportErrorpolars._plrr   pathlibr   polars._typingr   polars.dataframe.framer   polars.io.cloudr   polars.lazyframe.framer   r+   r(    r,   r*   <module>rF      s4   " " " " " "     - - - - - - - - - - + + + + + + ' ' ' ' ' ' ( ( ( ( ( (      8 7 7 7 7 7Z%% ( (''''''( ( ( ( ( ( ( ( ( ( ( ( ( ( (  1111111000000::::::000000 
 !%15OU%))b b b b b bJ 
 !%15OU%))p p p p p p p ps   AAA