
    .hN                    `    d dl mZ d dlmZ d dlmZ d dlmZ erd dl	m
Z
mZ ed	 	 	 	 	 ddZy)	    )annotations)TYPE_CHECKINGN)DEFAULT_QUERY_OPT_FLAGS)	LazyFrameQueryOptFlags)optimizationsc                   |j                         }| j                  j                  |j                        }t	        j
                  |      S )aO  
    Prepare the given LazyFrame for execution on Polars Cloud.

    Parameters
    ----------
    lf
        The LazyFrame to prepare.
    optimizations
        Optimizations to enable or disable in the query optimizer.

    Raises
    ------
    InvalidOperationError
        If the given LazyFrame is not eligible to be run on Polars Cloud.
        The following conditions will disqualify a LazyFrame from being eligible:

        - Contains a user-defined function
        - Scans or sinks to a local filesystem
    ComputeError
        If the given LazyFrame cannot be serialized.
    )__copy___ldfwith_optimizations_pyoptflagsplrprepare_cloud_plan)lfr   pylfs      Q/var/www/html/ai-service/venv/lib/python3.12/site-packages/polars/_utils/cloud.pyr   r      s=    4 "**,M77%%m&?&?@D!!$''    )r   r   r   r   returnbytes)
__future__r   typingr   polars._plr_plrr   polars.lazyframe.opt_flagsr   polarsr   r   r    r   r   <module>r      s=    "    >/ $;(( !( 	(r   