+
     hqD  c                   s    ^ RI t ^ RIHt ^ RIHt ^RIHt ^RIHt ^RI	H
t
 ^RIHt RtR	tR
tRtRtRtRtRtRtRtRtRt]]]]]]]]]]]].t ! R R4      t ! R R4      t ! R R4      t ! R R]4      tR tR# )    N)OrderedDict)ResponseError)Edge)VersionMismatchException)Node)PathzLabels addedzLabels removedzNodes createdzNodes deletedzRelationships deletedzProperties setzProperties removedzRelationships createdzIndices createdzIndices deletedzCached executionzinternal execution timec                   s&    ] tR t^)t^ t^t^t^tRtR# )ResultSetColumnTypes N)	__name__
__module____qualname____firstlineno__COLUMN_UNKNOWNCOLUMN_SCALARCOLUMN_NODECOLUMN_RELATION__static_attributes__r       F/usr/lib/python3.14/site-packages/redis/commands/graph/query_result.pyr   r   )   s    NMKOr   r   c                   sF    ] tR t^0t^ t^t^t^t^t^t	^t
^t^t^	t^
t^tRtR# )ResultSetScalarTypesr   N)r	   r
   r   r   VALUE_UNKNOWN
VALUE_NULLVALUE_STRINGVALUE_INTEGERVALUE_BOOLEANVALUE_DOUBLEVALUE_ARRAY
VALUE_EDGE
VALUE_NODE
VALUE_PATH	VALUE_MAPVALUE_POINTr   r   r   r   r   r   0   s>    MJLMMLKJJJIKr   r   c                   s  a  ] tR t^?t o R)R ltR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR t]R 4       tR t]R 4       t]R 4       t]R 4       t ]R 4       t!]R 4       t"]R 4       t#]R 4       t$]R  4       t%]R! 4       t&]R" 4       t']R# 4       t(]R$ 4       t)]R% 4       t*]R& 4       t+R't,V t-R(# )*QueryResultc                s,   Wn         . V n        . V n        V P                  V4       \	        V4      ^8X  d   V P                  V^ ,          4       R# V'       d   V P                  V4       R# V P                  VR,          4       V P                  V4       R# )z
A class that represents a result of the query operation.

Args:

graph:
    The graph on which the query was executed.
response:
    The response from the server.
profile:
    A boolean indicating if the query command was "GRAPH.PROFILE"
Ngraphheader
result_set_check_for_errorslenparse_statisticsparse_profileparse_resultsselfr$   responseZprofile   &&&&r   __init__ZQueryResult.__init__@   sx     
 	x(x=A!!(1+.x( !!(2,/x(r   c                s    \        V^ ,          \        4      '       d0   V^ ,          p\        V4      R8X  d   V^,          p\        V4      pVh\        VR,          \        4      '       d
   VR,          hR# )z*
Check if the response contains an error.
zversion mismatchNr"   )
isinstancer   strr   )r-   r.   ZerrorZversion   &&  r   r'   ZQueryResult._check_for_errors]   se     hqk=11QKE5z//"1+09K hrlM222, 3r   c                s    V P                  V4      V n        \        V P                  4      ^ 8X  d   R# V P                  V4      V n        R# z<
Parse the query execution result returned from the server.
Nparse_headerr%   r(   parse_recordsr&   r-   raw_result_set   &&r   r+   ZQueryResult.parse_resultsm   s>     ''7 t{{q ,,^<r   c                s    / V n         \        V4       F/  w  r#\        V\        4      '       g   K  VP	                  4       W&   K1  	  \
         F(  pV P                  WA4      pVf   K  WPP                   V&   K*  	  R# )z0
Parse the statistics returned in the response.
N)
statistics	enumerater1   bytesdecodeSTATS
_get_value)r-   Zraw_statisticsidxstatZsZv   &&    r   r)   ZQueryResult.parse_statisticsy   sd      #>2IC$&&&*kkm# 3 A2A}%&" r   c                s    V^ ,          pV# )z!
Parse the header of the result.
r   )r-   r9   r%      && r   r6   ZQueryResult.parse_header   s    
  "r   c                s    V^,           UUUu. uFQ  p\        V4       UUu. uF6  w  r4V P                  V P                  V,          ^ ,          ,          ! V4      NK8  	  uppNKS  	  ppppV# u uppi u upppi )6
Parses the result set and returns a list of records.
)r<   parse_record_typesr%   )r-   r9   rowrA   cellrecordsrC   r   r7   ZQueryResult.parse_records   sz     &a(

 ) "+3!/IC ''C(8(;<TB!/ ) 	 
 
s   A1<A+A1+A1c                s    / pV FA  pV P                   P                  V^ ,          4      pV P                  VR,          4      pWRV&   KC  	  V# )
Parse node / edge properties.
i   NNr$   Zget_propertyparse_scalarr-   Zprops
propertiespropZ	prop_nameZ
prop_valuerC   r   parse_entity_propertiesZ#QueryResult.parse_entity_properties   sO    
 
D

//Q8I**484J$.y! 
 r   c                s    \        V\        4      '       d   VP                  4       # \        V\        4      '       g   \        V4      # V# )z
Parse the cell as a string.
)r1   r=   r>   r2   r-   rH   r:   r   parse_stringZQueryResult.parse_string   s9     dE"";;= D#&&t9Kr   c                s   \        V^ ,          4      pRp\        V^,          4      ^ 8  d=   . pV^,           F-  pVP                  V P                  P	                  V4      4       K/  	  V P                  V^,          4      p\        W#VR7      # )z
Parse the cell to a node.
Nnode_idZlabelrO   )intr(   appendr$   	get_labelrQ   r   )r-   rH   rU   labelsinner_labelrO   rC   r   
parse_nodeZQueryResult.parse_node   sw     d1g,tAw<!F#Awwdjj22;?@  '11$q':
GjIIr   c                s    \        V^ ,          4      pV P                  P                  V^,          4      p\        V^,          4      p\        V^,          4      pV P                  V^,          4      p\	        WCWRVR7      # )
Parse the cell to an edge.
edge_idrO   rV   r$   Zget_relationrQ   r   r-   rH   r^   ZrelationZsrc_node_idZdest_node_idrO      &&     r   
parse_edgeZQueryResult.parse_edge   sk     d1g,::**473$q'l47|11$q':
<Z
 	
r   c                sx    V P                  V^ ,          4      pV P                  V^,          4      p\        W#4      # )
Parse the cell to a path.
rM   r   r-   rH   ZnodesZedgesr3   r   
parse_pathZQueryResult.parse_path   s7     !!$q'*!!$q'*E!!r   c                s    \        4       p\        V4      p\        ^ V^4       F:  pV P                  W,          4      pV P	                  W^,           ,          4      W%&   K<  	  V# )z
Parse the cell as a map.
r   r(   rangerS   rM   r-   rH   ZmZ	n_entriesiZkeyrC   r   	parse_mapZQueryResult.parse_map   sZ     MI	
 q)Q'A##DG,C&&tE{3AF ( r   c                s^    / p\        V^ ,          4      VR&   \        V^,          4      VR&   V# )z
Parse the cell to point.
ZlatitudeZ	longitudefloat)r-   rH   ZprD   r   parse_pointZQueryResult.parse_point   s2      d1g*tAw+r   c                    R# )z
Parse a null value.
Nr   rR   r:   r   
parse_nullZQueryResult.parse_null   s     r   c                    \        V4      # )z(
Parse the integer value from the cell.
)rV   rR   r:   r   parse_integerZQueryResult.parse_integer  s     4yr   c                s    \        V\        4      '       d   VP                  4       MTp \        V4      '       d   RMRpV#   \         d&    \
        P                  P                  R4       Rp T# i ; i)z$
Parse the cell value as a boolean.
TFzunknown boolean type
N)r1   r=   r>   	strtobool
ValueErrorsysstderrwrite)r-   valuescalarrD   r   parse_booleanZQueryResult.parse_boolean
  sh     #-UE":":	&u--T5F   	JJ56F	s   A ,A10A1c                rq   )z
Parse the cell as a double.
rl   rR   r:   r   parse_doubleZQueryResult.parse_double  s     T{r   c                s~    \        \        V4      4       Uu. uF  q P                  W,          4      NK  	  ppV# u upi )z
Parse an array of values.
rh   r(   rM   r-   rx   rj   ry   r3   r   parse_arrayZQueryResult.parse_array  s9     8=SZ7HI7H!##EH-7HI Js   :c                sD    \         P                  P                  R4       R# )z
Parse a cell of unknown type.
zUnknown type
N)ru   rv   rw   rR   r:   r   parse_unknownZQueryResult.parse_unknown#  s     	

)*r   c                sn    \        V^ ,          4      pV^,          pV P                  V,          ! V4      pV# )z5
Parse a scalar value from a cell in the result set.
)rV   parse_scalar_typesr-   rH   Zscalar_typerx   ry      &&   r   rM   ZQueryResult.parse_scalar*  s4     $q'lQ((5e<r   c                s|    V Uu. uF$  q"^ VP                  R4       P                  4       NK&  	  upV n        R# u upi )r    Z,N)ZindexZstripr&   )r-   r.   ZxrD   r   r*   ZQueryResult.parse_profile4  s1    @HI1Q.446IIs   *9c                s2    \        V P                  4      ^ 8H  # r    )r(   r&   r-      &r   is_emptyZQueryResult.is_empty7  s    4??#q((r   c                s    V FB  pW9   g   K  \        VP                  R 4      ^,          P                  R4      ^ ,          4      u # 	  R# )z: Z N)rm   Zsplit)rP   r;   rB   rD   r   r@   ZQueryResult._get_value:  s?    D|TZZ-a066s;A>??  r   c                sL    WP                   9   d   V P                   V,          # ^ # r   )r;   )r-   rB   r:   r   	_get_statZQueryResult._get_statB  s    (,(?tt$FQFr   c                ,    V P                  \        4      # )z/Returns the number of labels added in the query)r   LABELS_ADDEDr   r   r   labels_addedZQueryResult.labels_addedE  s     ~~l++r   c                r   )z1Returns the number of labels removed in the query)r   LABELS_REMOVEDr   r   r   labels_removedZQueryResult.labels_removedJ       ~~n--r   c                r   )z0Returns the number of nodes created in the query)r   NODES_CREATEDr   r   r   nodes_createdZQueryResult.nodes_createdO       ~~m,,r   c                r   )z0Returns the number of nodes deleted in the query)r   NODES_DELETEDr   r   r   nodes_deletedZQueryResult.nodes_deletedT  r   r   c                r   )z1Returns the number of properties set in the query)r   PROPERTIES_SETr   r   r   properties_setZQueryResult.properties_setY  r   r   c                r   )z5Returns the number of properties removed in the query)r   PROPERTIES_REMOVEDr   r   r   properties_removedZQueryResult.properties_removed^  s     ~~011r   c                r   )z8Returns the number of relationships created in the query)r   RELATIONSHIPS_CREATEDr   r   r   relationships_createdZ!QueryResult.relationships_createdc       ~~344r   c                r   )z8Returns the number of relationships deleted in the query)r   RELATIONSHIPS_DELETEDr   r   r   relationships_deletedZ!QueryResult.relationships_deletedh  r   r   c                r   )z2Returns the number of indices created in the query)r   INDICES_CREATEDr   r   r   indices_createdZQueryResult.indices_createdm       ~~o..r   c                r   )z2Returns the number of indices deleted in the query)r   INDICES_DELETEDr   r   r   indices_deletedZQueryResult.indices_deletedr  r   r   c                s2    V P                  \        4      ^8H  # )z:Returns whether or not the query execution plan was cached)r   CACHED_EXECUTIONr   r   r   cached_executionZQueryResult.cached_executionw  s     ~~./144r   c                r   )z.Returns the server execution time of the query)r   INTERNAL_EXECUTION_TIMEr   r   r   run_time_msZQueryResult.run_time_ms|  s     ~~566r   c                sv   \         P                  V P                  \         P                  V P                  \         P
                  V P                  \         P                  V P                  \         P                  V P                  \         P                  V P                  \         P                  V P                  \         P                  V P                   \         P"                  V P$                  \         P&                  V P(                  \         P*                  V P,                  \         P.                  V P0                  /# N)r   r   rp   r   rS   r   rr   r   rz   r   r{   r   r~   r   r[   r   rb   r   rf   r   rk   r    rn   r   r   r   r   r   r   ZQueryResult.parse_scalar_types  s     !++T__ --t/@/@ ..0B0B ..0B0B --t/@/@ ,,d.>.> ++T__ ++T__ ++T__ **DNN ,,d.>.> ..0B0B
 	
r   c                s    \         P                  V P                  \         P                  V P                  \         P
                  V P                  \         P                  V P                  /# r   )	r   r   rM   r   r[   r   rb   r   r   r   r   r   rF   ZQueryResult.parse_record_types  sN     !..0A0A ,,doo 00$// //1C1C	
 	
r   )r$   r%   r&   r;   NF).r	   r
   r   r   r0   r'   r+   r)   r6   r7   rQ   rS   r[   rb   rf   rk   rn   rp   rr   rz   r{   r~   r   rM   r*   r   Zstaticmethodr@   r   Zpropertyr   r   r   r   r   r   r   r   r   r   r   r   r   rF   r   __classdictcell__Z__classdict__   @r   r!   r!   ?   s    ): 
=' 	J"
&" 	
J)  G , , . . - - - - . . 2 2 5 5 5 5 / / / / 5 5 7 7 
 
  
 
r   r!   c                   sj   a  ] tR tRt o RtR tRR ltR tR tR t	R t
R	 tR
 tR tR tR tRtV tR# )AsyncQueryResulti  zd
Async version for the QueryResult class - a class that
represents a result of the query operation.
c                ro   )z3
To init the class you must call self.initialize()
Nr   r   r   r   r0   ZAsyncQueryResult.__init__  s     	r   c                sH  "   Wn         . V n        . V n        V P                  V4       \	        V4      ^8X  d   V P                  V^ ,          4       V # V'       d   V P                  V4       V # V P                  VR,          4       V P                  V4      G Rj  xL
  V #  L5i)z
Initializes the class.
Args:

graph:
    The graph on which the query was executed.
response:
    The response from the server.
profile:
    A boolean indicating if the query command was "GRAPH.PROFILE"
Nr"   r#   r,   r/   r   
initializeZAsyncQueryResult.initialize  s      
 	x(x=A!!(1+.  x(  !!(2,/$$X... /s   AB"?B"B B"c                sJ  "   Rp\        V^,          4      ^ 8  dE   . pV^,           F5  pTP                  V P                  P                  V4      G Rj  xL
 4       K7  	  V P	                  V^,          4      G Rj  xL
 p\        V^ ,          4      p\        WRVR7      #  LK L%5i)z
Parses a node from the cell.
NrT   )r(   rW   r$   rX   rQ   rV   r   )r-   rH   rY   rZ   rO   rU   rC   r   r[   ZAsyncQueryResult.parse_node  s      tAw<!F#AwwDJJ$8$8$EEF  '77Q@@
d1g,GjII F@s$   AB#B
'B#;B!<$B#!B#c                s   "   \        V^ ,          4      pV^,          p V P                  V,          ! V4      G Rj  xL
 pV#  L  \         d    T P                  T,          ! T4      p T# i ; i5i)z1
Parses a scalar value from the server response.
N)rV   r   Z	TypeErrorr   r   r   rM   ZAsyncQueryResult.parse_scalar  sr      $q'lQ	A22;?FFF
  G 	A,,[9%@F		As8   A/A AA  A/A $A,(A/+A,,A/c                s  "   . pV^,           Fi  p\        V4       UUu. uF>  w  rEV P                  V P                  V,          ^ ,          ,          ! V4      G Rj  xL
 NK@  	  pppVP                  V4       Kk  	  V#  L"u uppi 5i)rE   N)r<   rF   r%   rW   )r-   r9   rI   rG   rA   rH   Zrecordra   r   r7   ZAsyncQueryResult.parse_records  s      !!$$C "+3!/IC --dkk#.>q.AB4HHH!/   NN6" %  Is(   B;A?A=A?#B=A??Bc                s   "   V P                  V4      V n        \        V P                  4      ^ 8X  d   R# V P                  V4      G Rj  xL
 V n        R#  L5ir4   r5   r8   r:   r   r+   ZAsyncQueryResult.parse_results  sG      ''7 t{{q  $ 2 2> BBBs   AA	A
Ac                s   "   / pV FQ  pV P                   P                  V^ ,          4      G Rj  xL
 pV P                  VR,          4      G Rj  xL
 pWRV&   KS  	  V#  L. L5i)rJ   NrK   rL   rN   rC   r   rQ   Z(AsyncQueryResult.parse_entity_properties  s`     
 
D"jj55d1g>>I#00b::J$.y! 
 	 ?:s!   -A"AA"A A" A"c                s.  "   \        V^ ,          4      pV P                  P                  V^,          4      G Rj  xL
 p\        V^,          4      p\        V^,          4      pV P                  V^,          4      G Rj  xL
 p\	        WCWRVR7      #  LV L5i)r\   Nr]   r_   r`   ra   r   rb   ZAsyncQueryResult.parse_edge  s      d1g,00a99$q'l47|77Q@@
<Z
 	
	 : As"   8BBAB>B?BBc                s   "   V P                  V^ ,          4      G Rj  xL
 pV P                  V^,          4      G Rj  xL
 p\        W#4      #  L/ L5i)rc   Nrd   re   r3   r   rf   ZAsyncQueryResult.parse_path  sH      ''Q00''Q00E!! 10s   AAAAAAc                s   "   \        4       p\        V4      p\        ^ V^4       FB  pV P                  W,          4      pV P	                  W^,           ,          4      G Rj  xL
 W%&   KD  	  V#  L5i)z
Parse the cell to a map.
Nrg   ri   rC   r   rk   ZAsyncQueryResult.parse_map'  se      MI	
 q)Q'A##DG,C,,Ta%[99AF (  :s   AA/ A-!A/c                s   "   \        \        V4      4       Uu. uF!  q P                  W,          4      G Rj  xL
 NK#  	  ppV#  Lu upi 5i)z
Parse array value.
Nr|   r}   r3   r   r~   ZAsyncQueryResult.parse_array7  sE      >C3u:=NO=N))%(333=NO 4Os&   AAA
A AAA)r$   r%   r&   Nr   )r	   r
   r   r   Z__doc__r0   r   r[   rM   r7   r+   rQ   rb   rf   rk   r~   r   r   r   r   r   r   r     sH     
<J"
C
&"  r   r   c                sd    V P                  4       p V R9   d   R# V R9   d   R# \        RV : 24      h)z
Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
'val' is anything else.
TFzinvalid truth value )ZyZyesZtZtrueZonZ1)ZnZnoZfZfalseZoffZ0)Zlowerrt   )Zvalr   r   rs   rs   ?  s:     ))+C
22	5	5/w788r   )ru   Zcollectionsr   Zredisr   Zedger   Z
exceptionsr   Znoder   Zpathr   r   r   r   r   r   r   r   r   r   r   r   r   r?   r   r   r!   r   rs   r   r   r   <module>r      s    
 #    0  !/ !) / ##% 3  	   Z
 Z
z
`{ `F9r   