L i ddlmZddlZddlmZddlmZmZmZddl m Z ddl m Z m Z ddlmZmZer ddlmZdd lmZGd d e eee feeee e fZy) ) annotationsN)reduce) TYPE_CHECKINGAnyProtocol) LazyNamespace) NativeExprT NativeFrameT)SQLExprT SQLLazyFrameT)Iterable) PythonLiteralceZdZd dZddZ d ddZddZddZddZddZ dd Z dd Z dd Z d dd Z y) SQLNamespacecyN)selfnameargss ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/narwhals/_sql/namespace.py _functionzSQLNamespace._functioncyrr)rvalues r_litzSQLNamespace._litrrNcyrr)r conditionr otherwises r_whenzSQLNamespace._whens rcyrr)rexprss r _coalescezSQLNamespace._coalescerrcNdfd }jj|g|S)NcRr fd|D}ttj|S)Nc3`K|]%}j|jd'yw)FNr$r.0colrs r z.func..#s%N#sDIIe,<=N+.)roperatoror_cols ignore_nullsrs rfuncz)SQLNamespace.any_horizontal..func!s!NN(,,- -rr1zIterable[NativeExprT]returnr _expr_from_elementwise_horizontal_oprr2r#r3s`` rany_horizontalzSQLNamespace.any_horizontal s& . :tzz99$GGGrcNdfd }jj|g|S)NcRr fd|D}ttj|S)Nc3`K|]%}j|jd'yw)TNr(r)s rr,z.func..+s$MsDIIdO<Mr-)rr.and_r0s rr3z)SQLNamespace.all_horizontal..func)s!MM(--. .rr4r6r9s`` rall_horizontalzSQLNamespace.all_horizontal(s& / :tzz99$GGGrcJdfd }jj|g|S)Nc*jdg|S)Ngreatestrr1rs rr3z)SQLNamespace.max_horizontal..func1s!4>>*4t4 4rr4r6rr#r3s` rmax_horizontalzSQLNamespace.max_horizontal0s& 5:tzz99$GGGrcJdfd }jj|g|S)Nc*jdg|S)NleastrCrDs rr3z)SQLNamespace.min_horizontal..func7s!4>>'1D1 1rr4r6rEs` rmin_horizontalzSQLNamespace.min_horizontal6s& 2:tzz99$GGGrcJdfd }jj|g|S)NcJttjfd|DS)Nc3`K|]%}j|jd'yw)rNr(r)s rr,z.func..?s$QSt~~c499Q<@Qr-)rr.addrDs rr3z)SQLNamespace.sum_horizontal..func=s QDQ rr4r6rEs` rsum_horizontalzSQLNamespace.sum_horizontal<s&  :tzz99$GGGrcJdfd }jj|g|S)Nc"j|Sr)r$rDs rr3z#SQLNamespace.coalesce..funcFs!4>>4( (rr4r6rEs` rcoalescezSQLNamespace.coalesceEs& ):tzz99$GGGrcdfd }dfd }|jj|||Sjj||||S)Nc4j|d|dS)Nrr!rDs rr3z$SQLNamespace.when_then..funcNs::d1gtAw/ /rc<j|d|d|dS)NrUrrVrDs rfunc_with_otherwisez3SQLNamespace.when_then..func_with_otherwiseQs"::d1gtAwQ8 8r)r1zlist[NativeExprT]r5r r6)r predicatethenr r3rYs` r when_thenzSQLNamespace.when_thenKsN 0 9  ::==dD)T Tzz99 y)  r)rstrrzNativeExprT | PythonLiteralr5r )rrr5r r)rr rr r zNativeExprT | Noner5r )r#r r5r )r#r r2boolr5r )r#r r5r )rZr r[r r zSQLExprT | Noner5r )__name__ __module__ __qualname__rrr!r$r:r?rFrJrOrRr\rrrrrs[2 )- &    AHHH H HHQU  !  )1  >M    rr) __future__rr. functoolsrtypingrrrnarwhals._compliantrnarwhals._compliant.typingr r narwhals._sql.typingr r collections.abcr narwhals.typingrrrrrrjsR"//-@8(-G -<78 ]HlK ?@G r