
    'h-                       S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJrJrJrJr  S	rS	rS	rS	rS	rS	rS	rS	rS	rS	rS	rS	rS	rS	r  " S
 S\5      r!S+S jr"\(       aQ  S SK#r#S SK$r$S SK%r%S SK&r&S SK'r'S SK(r(S SK)r)S SK*r*S SK+r+S SK,r,S SK-r-S SK.r.S SK/r/S SK0r0S SK1r1S SK2r2S SK3r3S SK4r4S SK5r5S SK6r6O\"" S5      u  r#r7\"" S5      u  r$r7\"" S5      u  r%r7\"" S5      u  r&r7\"" S5      u  r'r7\"" S5      u  r(r\"" S5      u  r)r8\"" S5      u  r*r\"" S5      u  r+r\"" S5      u  r,r\"" S5      u  r-r\"" S5      u  r.r\"" S5      u  r/r\"" S5      u  r0r\"" S5      u  r1r\"" S5      u  r2r\"" S5      u  r3r\"" S5      u  r4r\"" S5      u  r6r\"" S 5      u  r5r \S,S! j5       r9S	S".S-S# jjr:S	S".S-S$ jjr;S	S".S-S% jjr<S	S".S-S& jjr=S	S".S-S' jjr>S	S".S-S( jjr?     S.             S/S) jjr@/ S*QrAg)0    )annotationsN)Hashable)cache)import_module)	find_spec)
ModuleType)TYPE_CHECKINGAnyClassVarcastTc                  n   ^  \ rS rSr% SrSrSSSSS.rS	\S
'         SU 4S jjrSS jr	SS jr
SrU =r$ )_LazyModule   a  
Module that can act both as a lazy-loader and as a proxy.

Notes
-----
We do NOT register this module with `sys.modules` so as not to cause
confusion in the global environment. This way we have a valid proxy
module for our own use, but it lives *exclusively* within polars.
Tznp.zpd.zpa.zpc.)numpypandaspyarrowpolars_cloudzClassVar[dict[str, str]]_mod_pfxc               Z   > X l         Xl        [        5       U l        [        TU ]  U5        g)a?  
Initialise lazy-loading proxy module.

Parameters
----------
module_name : str
    the name of the module to lazy-load (if available).

module_available : bool
    indicate if the referenced module is actually available (we will proxy it
    in both cases, but raise a helpful error when invoked if it doesn't exist).
N)_module_available_module_nameglobals_globalssuper__init__)selfmodule_namemodule_available	__class__s      fC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\polars/dependencies.pyr   _LazyModule.__init__0   s'    $ "2'	%    c                    [        U R                  5      nXR                  U R                  '   U R                  R                  UR                  5        U$ N)r   __name__r   r   __dict__update)r   modules     r    _import_LazyModule._importG   s=    t}}-+1d''(V__-r"   c                   US:X  a  U R                   < SU< 3n[        U5      eU R                  (       a  U R                  5       n[	        X15      $ US:X  a  U R                   $ [
        R                  " SU5      (       a  US:w  a  g U R                  R                  U R                   S5      nU U SU R                   < S3n[        U5      S e)	N__wrapped__z object has no attribute r%   z	^__\w+__$__version__ z
 requires z module to be installed)
r   AttributeErrorr   r)   getattrrematchr   getModuleNotFoundError)r   namemsgr(   pfxs        r    __getattr___LazyModule.__getattr__N   s     = &&))B4(KC %% !!\\^F6(( Z$$$XXlD))dm.C  --##D$5$5r:CE$z$*;*;)>>UVC%c*4r"   )r   r   r   )r   strr   boolreturnNone)r<   r   )r5   r:   r<   r
   )r%   
__module____qualname____firstlineno____doc____lazy__r   __annotations__r   r)   r8   __static_attributes____classcell__)r   s   @r    r   r      s\     H 	*H& && 	&
 
&.5 5r"   r   c                    U [         R                  ;   a  [         R                  U    S4$  [        U 5      nUSL =(       d    UR                  SL (       + n[        U US9U4$ ! [         a    Sn Nf = f)a  
Lazy import the given module; avoids up-front import costs.

Parameters
----------
module_name : str
    name of the module to import, eg: "pyarrow".

Notes
-----
If the requested module is not available (eg: has not been installed), a proxy
module is created in its place, which raises an exception on any attribute
access. This allows for import and use as normal, without requiring explicit
guard conditions - if the module is never used, no exception occurs; if it
is, then a helpful exception is raised.

Returns
-------
tuple of (Module, bool)
    A lazy-loading module and a boolean indicating if the requested/underlying
    module exists (if not, the returned module is a proxy).
TNF)r   r   )sysmodulesr   loaderr4   r   )r   module_specr   s      r    _lazy_importrK   i   s    0 ckk!{{;'--!, +t 3 Q{7I7IT7QR 	#-	
 	   ! !s   )A   A/.A/dataclasseshtmljsonpickle
subprocessaltairboto3	deltalakefsspecgeventgreat_tables
hypothesisr   r   r   r   pydantic	pyicebergtorchpytzc                l   ^  [        U4S jU R                  5        5       5      $ ! [         a     gf = f)Nc              3  F   >#    U  H  nT S 3[        U5      ;   v   M     g7f).Nr:   ).0otype_s     r    	<genexpr>_might_be.<locals>.<genexpr>   s      <)QeWA;#a&()s   !F)anymro	TypeError)clsrb   s    `r    	_might_beri      s1    
<#'')<<< s   "& 
33)
check_typec               t    [         =(       a,    [        [        [        U(       a  [	        U 5      OU 5      S5      $ )Nr   )_NUMPY_AVAILABLEri   r   r   typeobjrj   s     r    _check_for_numpyrp      *     	XJtCyC8'! r"   c               t    [         =(       a,    [        [        [        U(       a  [	        U 5      OU 5      S5      $ )Nr   )_PANDAS_AVAILABLEri   r   r   rm   rn   s     r    _check_for_pandasrt      s*     XJtCyC8(" r"   c               t    [         =(       a,    [        [        [        U(       a  [	        U 5      OU 5      S5      $ )Nr   )_PYARROW_AVAILABLEri   r   r   rm   rn   s     r    _check_for_pyarrowrw      s*     )XJtCyC8)# r"   c               t    [         =(       a,    [        [        [        U(       a  [	        U 5      OU 5      S5      $ )NrX   )_PYDANTIC_AVAILABLEri   r   r   rm   rn   s     r    _check_for_pydanticrz      s*     9XJtCyC8*$ r"   c               t    [         =(       a,    [        [        [        U(       a  [	        U 5      OU 5      S5      $ )NrZ   )_TORCH_AVAILABLEri   r   r   rm   rn   s     r    _check_for_torchr}      rq   r"   c               t    [         =(       a,    [        [        [        U(       a  [	        U 5      OU 5      S5      $ )Nr[   )_PYTZ_AVAILABLEri   r   r   rm   rn   s     r    _check_for_pytzr      s*     yXJtCyC8&  r"   c           
        SSK Jn  SSKJn  U R	                  SS5      S   n [        U 5      n	U(       aa  U" U5      nU" U	R                  5      nX:  aB  U SU SSR                  S U 5       5       SSR                  S U 5       5       S3nU" U5      eU	$ ! [         ab    U(       a  UR                  S5       S3OSn
U(       a  SUR                  S5       3OSnU
 SU  SU S	3U=(       d    S
U S3-   n[        U5      Sef = f)a  
Import an optional dependency, returning the module.

Parameters
----------
module_name : str
    Name of the dependency to import.
err_prefix : str, optional
    Error prefix to use in the raised exception (appears before the module name).
err_suffix: str, optional
    Error suffix to use in the raised exception (follows the module name).
min_version : {str, tuple[int]}, optional
    If a minimum module version is required, specify it here.
min_err_prefix : str, optional
    Override the standard "requires" prefix for the minimum version error message.
install_message : str, optional
    Override the standard "Please install it using..." exception message fragment.

Examples
--------
>>> from polars.dependencies import import_optional
>>> import_optional(
...     "definitely_a_real_module",
...     err_prefix="super-important package",
... )  # doctest: +SKIP
ImportError: super-important package 'definitely_a_real_module' not installed.
Please install it using the command `pip install definitely_a_real_module`.
r   )parse_version)ModuleUpgradeRequiredErrorr^       r.   'z.
z.Please install using the command `pip install z`.Nc              3  8   #    U  H  n[        U5      v   M     g 7fr$   r_   r`   vs     r    rc   "import_optional.<locals>.<genexpr>/  s     8KqCFFK   z or higher (found c              3  8   #    U  H  n[        U5      v   M     g 7fr$   r_   r   s     r    rc   r   0  s     #@KqCFFKr   ))polars._utils.variousr   polars.exceptionsr   splitr   ImportErrorstripr4   r-   join)r   
err_prefix
err_suffixmin_versionmin_err_prefixinstall_messager   r   module_rootr(   prefixsuffixerr_messagemod_versionr6   s                  r    import_optionalr      s<   H 4<##C+A.K	9{+ #K0#F$6$67$!"!K=888K889 :88#@K#@@AD 
 -S11M)  90:J$$S)*!,0:1Z%%c*+,+axs; P?}BO
 "+.D89s   B A,D)&rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   r   r   r   rX   rY   r   rZ   r[   rp   rt   rw   rz   r}   r   _ALTAIR_AVAILABLE_DELTALAKE_AVAILABLE_FSSPEC_AVAILABLE_GEVENT_AVAILABLE_GREAT_TABLES_AVAILABLE_HYPOTHESIS_AVAILABLErl   rs   _POLARS_CLOUD_AVAILABLErv   ry   _PYICEBERG_AVAILABLEr|   )r   r:   r<   ztuple[ModuleType, bool])rh   rm   rb   r:   r<   r;   )ro   r
   rj   r;   r<   r;   )zrequired packagez	not foundNrequiresN)r   r:   r   r:   r   r:   r   zstr | tuple[int, ...] | Noner   r:   r   z
str | Noner<   r
   )B
__future__r   r1   rG   collections.abcr   	functoolsr   	importlibr   importlib.utilr   typesr   typingr	   r
   r   r   r   r   r   r   r   r   rl   rs   r   rv   ry   r   r|   r   r   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   r   r   r   r   rX   rY   r[   rZ   __BOTO3_AVAILABLEri   rp   rt   rw   rz   r}   r   r   __all__ r"   r    <module>r      s   " 	 
 $  # $  5 5             J5* J5Z*Z  "-0NK6"GD!6"GD!X&IFA .MJ !-X 6F*73E&2;&?#I# ,X 6F ,X 6F,8,H)L)(4\(B%J%*73E ,X 6F,8,H)L)".y"9G$0$<!H!&2;&?#I#*73E(0D/   6:  7;  8<  9=  6:  59  )!04$"&>>> > .	>
 >  > 	>B+r"   