
    dhW
                    b    S SK Jr  S SKJrJrJrJr  S SKJr  \(       a  S SK	J
r
   " S S5      rg)    )annotations)TYPE_CHECKINGIteratorListOptional)get_from_envODPSc                  f    \ rS rSrSrS
S jr\SSS.         SS jj5       rSS jrSS jr	S	r
g)MaxComputeAPIWrapper   z7Interface for querying Alibaba Cloud MaxCompute tables.c                    Xl         g)z^Initialize MaxCompute document loader.

Args:
    client: odps.ODPS MaxCompute client object.
Nclient)selfr   s     a/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/utilities/max_compute.py__init__MaxComputeAPIWrapper.__init__   s	         N)	access_idsecret_access_keyc                   SSK Jn  U=(       d    [        SS5      nU=(       d    [        SS5      nU" UUUUS	9nUR	                  U5      (       d  [        S
U S35      eU " U5      $ ! [         a  n[        S5      UeSnAff = f)a"  Convenience constructor that builds the odsp.ODPS MaxCompute client from
    given parameters.

Args:
    endpoint: MaxCompute endpoint.
    project: A project is a basic organizational unit of MaxCompute, which is
        similar to a database.
    access_id: MaxCompute access ID. Should be passed in directly or set as the
        environment variable `MAX_COMPUTE_ACCESS_ID`.
    secret_access_key: MaxCompute secret access key. Should be passed in
        directly or set as the environment variable
        `MAX_COMPUTE_SECRET_ACCESS_KEY`.
r   r	   zCould not import pyodps python package. Please install it with `pip install pyodps` or refer to https://pyodps.readthedocs.io/.Nr   MAX_COMPUTE_ACCESS_IDr   MAX_COMPUTE_SECRET_ACCESS_KEY)r   r   projectendpointzThe project "z" does not exist.)odpsr
   ImportErrorr   exist_project
ValueError)clsr   r   r   r   r
   exr   s           r   from_params MaxComputeAPIWrapper.from_params   s    ,	! Sk;R!S	- 
!@2
 /	
 ##G,,}WI5FGHH6{'  	2 		s   A( (
B2A>>Bc              #    #    U R                   R                  U5      R                  5        nUR                  S:X  a  [	        S5      eU H  nU VVs0 sH  u  pEXE_M	     snnv   M     S S S 5        g s  snnf ! , (       d  f       g = f7f)Nr   zTable contains no data.)r   execute_sqlopen_readercountr    )r   queryreaderrecordkvs         r   
lazy_queryMaxComputeAPIWrapper.lazy_queryC   sr     [[$$U+779V||q  !:;; (./qt// ! :9 0	 :9s.   *B	&A8A2

A8)	B	2A88
BB	c                6    [        U R                  U5      5      $ )N)listr.   )r   r)   s     r   r)   MaxComputeAPIWrapper.queryK   s    DOOE*++r   r   )r   r
   )
r   strr   r3   r   Optional[str]r   r4   returnr   )r)   r3   r5   zIterator[dict])r)   r3   r5   z
List[dict])__name__
__module____qualname____firstlineno____doc__r   classmethodr#   r.   r)   __static_attributes__ r   r   r   r      sa    A  $(+/** *
 !* )* 
* *X0,r   r   N)
__future__r   typingr   r   r   r   langchain_core.utilsr   r   r
   r   r=   r   r   <module>rA      s#    " : : -A, A,r   