o
    ¹­§im  ã                   @  sR   d dl mZ d dlmZ d dlmZ er d dlmZ d dlm	Z	 G dd„ dƒZ
dS )	é    )Úannotations)ÚTYPE_CHECKING)Úwrap_df)Ú	DataFrame)ÚPyInProcessQueryc                   @  s8   e Zd ZdZddd„Zddd	„Zddd„Zddd„ZdS )ÚInProcessQueryzß
    A placeholder for an in process query.

    This can be used to do something else while a query is running.
    The queries can be cancelled. You can peek if the query is finished,
    or you can await the result.
    Úipqr   ÚreturnÚNonec                 C  s
   || _ d S )N)Ú_inner)Úselfr   © r   úR/home/app/Keep/.python/lib/python3.10/site-packages/polars/lazyframe/in_process.pyÚ__init__   s   
zInProcessQuery.__init__c                 C  s   | j  ¡  dS )z)Cancel the query at earliest convenience.N)r   Úcancel©r   r   r   r   r      ó   zInProcessQuery.cancelúDataFrame | Nonec                 C  s   | j  ¡  }durt|ƒS dS )z”
        Fetch the result.

        If it is ready, a materialized DataFrame is returned.
        If it is not ready it will return `None`.
        N)r   Úfetchr   )r   Úoutr   r   r   r      s   zInProcessQuery.fetchr   c                 C  s   t | j ¡ ƒS )zAwait the result synchronously.)r   r   Úfetch_blockingr   r   r   r   r   (   r   zInProcessQuery.fetch_blockingN)r   r   r	   r
   )r	   r
   )r	   r   )r	   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s    


r   N)Ú
__future__r   Útypingr   Zpolars._utils.wrapr   Zpolarsr   Zpolars._plrr   r   r   r   r   r   Ú<module>   s    