
    AHj
                    t    d dl mZ d dlmZmZmZ erd dlmZ d dlm	Z	 e G d de             Z
 G d d      Zy	)
    )annotations)TYPE_CHECKINGProtocolruntime_checkable)	DataFrame)	LazyFramec                  <    e Zd ZdZedd       Zedd       ZddZy)	QueryResult  The result of a Polars query.

    .. note::
     This object should not be instantiated directly by the user.

    .. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.
    c                     y)The first n rows of the result.N selfs    U/root/tools/cai/cai_env/lib/python3.12/site-packages/polars/lazyframe/query_result.pyheadzQueryResult.head        	    c                     y),Total rows that are outputted by the result.Nr   r   s    r   n_rows_totalzQueryResult.n_rows_total   r   r   c                     y)-Convert the `QueryResult` into a `LazyFrame`.Nr   r   s    r   lazyzQueryResult.lazy    s    r   NreturnzDataFrame | Noner   z
int | Noner   r   )__name__
__module____qualname____doc__propertyr   r   r   r   r   r   r
   r
   
   s4        r   r
   c                  T    e Zd ZdZd	dZed
d       Zedd       ZddZddZ	ddZ
y)SingleNodeQueryResultr   c                    || _         y )N)_df)r   dfs     r   __init__zSingleNodeQueryResult.__init__0   s	    r   c                6    | j                   j                         S )r   )r'   r   r   s    r   r   zSingleNodeQueryResult.head3   s     xx}}r   c                .    | j                   j                  S )r   )r'   heightr   s    r   r   z"SingleNodeQueryResult.n_rows_total8   s     xxr   c                6    | j                   j                         S )r   )r'   r   r   s    r   r   zSingleNodeQueryResult.lazy=   s    xx}}r   c                z    dd l }|j                  d      5  d| j                   dcd d d        S # 1 sw Y   y xY w)Nr   Ttbl_hide_dataframe_shapez(
        QueryResult; head:
            z	
        )polarsConfigr   )r   pls     r   __repr__zSingleNodeQueryResult.__repr__A   s@    YYY5 	YYK 		 	 	s   1:c                    ddl }|j                  d      5  | j                  j                         j	                         }ddd       d d}d| dS # 1 sw Y   xY w)	z<Format output data in HTML for display in Jupyter Notebooks.r   NTr/   z
        <div style="margin-bottom: 16px;">
            <h3 style="margin: 0 0 8px 0; color: #333; font-family: sans-serif; font-size: 14px; font-weight: 600;">QueryResult; head:</h3>
            <div>z</div>
        </div>
        zq
        <div style="padding: 12px; border: 1px solid #ddd; border-radius: 4px; background: white;">
            z
        </div>
        )r1   r2   r'   r   _repr_html_)r   r3   	head_htmlhead_sections       r   r6   z!SingleNodeQueryResult._repr_html_J   sq    YYY5 	6335I	6  	N 	 		6 	6s   )AAN)r(   r   r   Noner   r   r   )r   str)r   r    r!   r"   r)   r#   r   r   r   r4   r6   r   r   r   r%   r%   %   sC        r   r%   N)
__future__r   typingr   r   r   polars.dataframer   polars.lazyframer   r
   r%   r   r   r   <module>r?      s<    " = =** (  47 7r   