
    Mh                         S SK J r   S SKrS SKrS SKrS SKJr  S SKrS SKJ	r	J
r
Jr  S SKJr  S SKJr  S SKJrJr  S rS r\R,                  " \\\\
// S	QS
9S 5       r " S S5      r " S S5      r " S S5      rg)    )datetimeN)PYPY)	DataFrameIndexSeries)PandasDelegate)NoNewAttributesMixinPandasObjectc                 $    [        SU 040 UD6S   $ )Nar   xkwargss     U/var/www/html/env/lib/python3.13/site-packages/pandas/tests/base/test_constructors.pyseries_via_frame_from_dictr      s    c1X((--    c                      [        U 40 UD6S   $ )Nr   r   r   s     r   series_via_frame_from_scalarr      s    Q!&!!$$r   )r   zDataFrame-dictzDataFrame-arrayr   )paramsidsc                     U R                   $ N)param)requests    r   constructorr      s     ==r   c                       \ rS rSr " S S5      r " S S\\5      rS r\	R                  R                  \SS9S	 5       rS
rg)TestPandasDelegate,   c                   B    \ rS rSrS/rS/rS rS r\" \\SS9r	S r
S	rg
)TestPandasDelegate.Delegator-   proptest_methodc                     Xl         g r   r#   )selfvalues     r   	_set_prop&TestPandasDelegate.Delegator._set_prop1   s    Ir   c                     U R                   $ r   r&   )r'   s    r   	_get_prop&TestPandasDelegate.Delegator._get_prop4   s    99r   zfoo property)docc                     g)za test methodN )r'   argsr   s      r   r$   (TestPandasDelegate.Delegator.test_method9   s    r   r&   N)__name__
__module____qualname____firstlineno___properties_methodsr)   r,   propertyr#   r$   __static_attributes__r0   r   r   	Delegatorr!   -   s/    h!?		 	9.A	 r   r;   c                       \ rS rSrSS jrSrg)TestPandasDelegate.Delegate<   Nc                     Xl         g r   obj)r'   rA   s     r   __init__$TestPandasDelegate.Delegate.__init__=   s    Hr   r@   )returnN)r3   r4   r5   r6   rB   r:   r0   r   r   Delegater=   <   s    	r   rE   c                    U R                   R                  U R                  U R                  R                  SS9  U R                   R                  U R                  U R                  R                  SS9  U R                  U R                  5       5      nSn[
        R                  " [        US9   UR                    S S S 5        Sn[
        R                  " [        US9   SUl        S S S 5        Sn[
        R                  " [        US9   UR                    S S S 5        g ! , (       d  f       Nj= f! , (       d  f       NP= f! , (       d  f       g = f)Nr9   )delegate	accessorstypmethodz#You cannot access the property propmatchzThe property prop cannot be set   )	rE   _add_delegate_accessorsr;   r7   r8   pytestraises	TypeErrorr#   )r'   rG   msgs      r   test_invalid_delegation*TestPandasDelegate.test_invalid_delegation@   s    
 	--^^nn00 	. 	

 	--^^t~~/F/FH 	. 	
 ==!123]]9C0MM 1 0]]9C0HM 1 4]]9C0MM 10 10 10 10s$   -DD/E 
D,/
D= 
Eznot relevant for PyPy)reasonc                 n    U R                  U R                  5       5      n[        R                  " U5        g r   )rE   r;   sys	getsizeof)r'   rG   s     r   test_memory_usage$TestPandasDelegate.test_memory_usage\   s%    
 ==!12hr   r0   N)r3   r4   r5   r6   r;   r   r
   rE   rS   rO   markskipifr   rY   r:   r0   r   r   r   r   ,   sH       >< 8 [[%<=  > r   r   c                       \ rS rSrS rSrg)TestNoNewAttributesMixine   c                     " S S[         5      nU" 5       n[        US5      (       a   eSUl        UR                  S:X  d   eUR                  5         S[	        U5      ;   d   e[        US5      (       d   eSn[        R                  " [        US9   SUl	        S S S 5        [        US5      (       a   eg ! , (       d  f       N"= f)Nc                       \ rS rSrSrg).TestNoNewAttributesMixin.test_mixin.<locals>.Tg   r0   N)r3   r4   r5   r6   r:   r0   r   r   Trb   g   s    r   rd   __frozentestz You cannot add any new attributerK   b)
r	   hasattrr   _freezedirgetattrrO   rP   AttributeErrorrg   )r'   rd   trR   s       r   
test_mixin#TestNoNewAttributesMixin.test_mixinf   s    	$ 	 C1j))))ssf}}			SV###q*%%%%0]]>5AC 6 1c??""? 65s   B66
Cr0   N)r3   r4   r5   r6   rn   r:   r0   r   r   r^   r^   e   s    #r   r^   c                      \ rS rSr\R
                  R                  S\R                  " S/SS9\R                  " \	" SSS5      /\
S9\R                  " \R                  " SS5      /\
S9\R                  " S/\
S9// S	QS
9S 5       rS rSrg)TestConstructionz   r   z
2263-01-01datetime64[D]dtypei     D)rs   zobject-datetime.datetimezobject-numpy-scalarobject-string)r   c                    UR                   R                  S:X  a  U" U5      nUR                   S:X  d   eO}U" U5      nU(       a7  SUR                  R                  R                  ;   a  UR                   S:X  d   eOUR                   S:X  d   e[
        R                  " UR                  5       U5        Sn[        R                  " [        R                  R                  US9   U" USS	9  S S S 5        g ! , (       d  f       g = f)
NMzM8[s]rx   stringobjectz4Out of bounds|Out of bounds .* present at position 0rK   zdatetime64[ns]rt   )ru   kindnodecallspecidtmassert_numpy_array_equalto_numpyrO   rP   pderrorsOutOfBoundsDatetime)r'   r   r   r   using_infer_stringresultrR   s          r   $test_constructor_datetime_outofbound5TestConstruction.test_constructor_datetime_outofbound~   s    . 77<<3 ^F<<7*** ^F!o9N9N9Q9Q&Q||x///||x///''(91= E]]29988D!12 EDDs   "C33
Dc                    [         R                  " S/SS9n[        R                  R                  R
                  R                  X"R                  S9nU" U5      nUR                  UR                  :X  d   eU" U5      n[        R                  " XT5        SUR                  l        U" U5      n[        R                  " XT5        g )Nz2020-01-01T00:00:00.000000zdatetime64[us]rt   F)nparrayr   corearraysDatetimeArray_simple_newru   r   assert_equalflags	writeable)r'   r   arrdtaexpectedr   s         r   test_constructor_datetime_nonns0TestConstruction.test_constructor_datetime_nonns   s    hh45=MNggnn**66s))6Ls#~~***S!
) $		S!
)r   r0   N)r3   r4   r5   r6   rO   r[   parametrizer   r   r   r|   
datetime64r   r   r:   r0   r   r   rq   rq   z   s     [[HHl^?;HHhtQ*+6:HHbmmL#67vFHHl^62		

  334*r   rq   )r   rW   numpyr   rO   pandas.compatr   pandasr   r   r   r   pandas._testing_testingr   pandas.core.accessorr   pandas.core.baser	   r
   r   r   fixturer   r   r^   rq   r0   r   r   <module>r      s     
     
  /.% "$	 	A6  6 r# #*9* 9*r   