a
    j=ic                      @  s   d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlm	Z
 G dd dZG dd deZdd	 Zd
d Zdd ZG dd deZG dd deZdS )    )annotationsN)apic                   @  s   e Zd ZdddZdS )BaseNc                 C  sJ   t dd t|D }|d ur2t t|t| }t |}t|| d S )Nc                 s  s$   | ]}| d s|dkr|V  qdS )__r   N)
startswith).0f r	   j/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/pandas/tests/api/test_api.py	<genexpr>   s   zBase.check.<locals>.<genexpr>)sorteddirsettmZassert_almost_equal)self	namespaceexpectedignoredresultr	   r	   r
   check   s    z
Base.check)N)__name__
__module____qualname__r   r	   r	   r	   r
   r      s   r   c                   @  s   e Zd ZU g dZg dZg dZddgZded< g dZg d	Z	g d
Z
ded< dgZded< g Zded< g dZg dZg dZdgZg dZg Zded< g Zded< g dZdd Zdd Zdd ZdS )	TestPDApi)testslocaleZconftest)	r   ZarraysoptionstesttestingerrorsZplottingioZtseries)compatcorepandasutilnpdatetimez	list[str]deprecated_modules)Z
IndexSliceZNaTZNA)+Z
ArrowDtypeZCategoricalZCategoricalIndexZ	DataFrameZ
DateOffsetZDatetimeIndexZ	ExcelFileZExcelWriterFloat64IndexFlagsZGrouperZHDFStoreIndex
Int64IndexZ
MultiIndexZPeriodZPeriodIndexZ
RangeIndexUInt64IndexZSeriesZSparseDtypeZStringDtypeZ	TimedeltaZTimedeltaIndex	TimestampZIntervalZIntervalIndexZCategoricalDtypeZPeriodDtypeZIntervalDtypeZDatetimeTZDtypeZBooleanDtypeZ	Int8DtypeZ
Int16DtypeZ
Int32DtypeZ
Int64DtypeZ
UInt8DtypeZUInt16DtypeZUInt32DtypeZUInt64DtypeZFloat32DtypeZFloat64DtypeZNamedAgg)r(   r+   r,   deprecated_classesSparseArraydeprecated_classes_in_futuremodules)arrayZbdate_rangeconcatZcrosstabcutZ
date_rangeZinterval_rangeevalZ	factorizeZget_dummiesZfrom_dummiesZ
infer_freqZisnaZisnullZlreshapeZmeltZnotnaZnotnulloffsetsmergeZmerge_orderedZ
merge_asofZperiod_rangeZpivotZpivot_tableZqcutZshow_versionsZtimedelta_rangeuniqueZvalue_countsZwide_to_long)Zreset_optionZdescribe_option
get_optionZoption_contextZ
set_optionZset_eng_float_format)Zread_clipboardZread_csvZ
read_excelZread_fwfZread_gbqZread_hdfZ	read_htmlZread_xml	read_jsonZread_pickleZread_sasZread_sqlZread_sql_queryZread_sql_tableZ
read_stataZ
read_tableZread_featherZread_parquetZread_orcZ	read_spssZjson_normalize)to_datetimeZ
to_numericZ	to_pickleZto_timedeltadeprecated_funcs_in_futuredeprecated_funcs)_configZ_libsZ_is_numpy_dev_testingZ_typing_versionc                 C  sX   | j | j | j | j | j | j | j | j | j | j	 | j
 }| jt|| jd d S )N)r   r   r   )
public_libprivate_libmiscr1   classesfuncsfuncs_option
funcs_read
funcs_jsonfuncs_toprivate_modulesr   pdr   )r   Z
checktheser	   r	   r
   test_api   s.    	
zTestPDApi.test_apic                 C  sr   t | j| j | j | j | j | j | j | j | j	 t | j
 }t tj}|| }|r^J || }|rnJ d S N)r   rA   rC   r1   rD   rE   rF   rG   rH   rI   r.   rK   __all__)r   r   actualZ
extraneousmissingr	   r	   r
   test_api_all   s4    

zTestPDApi.test_api_allc              	   C  s`   | j | j | j | j | j }|D ]8}tt tt	|}W d    q"1 sP0    Y  q"d S rM   )
r'   r.   r0   r=   r<   r   assert_produces_warningFutureWarninggetattrrK   )r   Zdeprecated_listZdepr_r	   r	   r
   	test_depr   s    zTestPDApi.test_deprN)r   r   r   r   rA   rB   r'   __annotations__rC   rD   r.   r0   r1   rE   rF   rG   rH   rI   r<   r=   rJ   rL   rQ   rV   r	   r	   r	   r
   r      s(   
/#
	r   c                  C  s   ddl m }  dd l}| Z |dt | ddddd| dddddksNJ t| ddddd| shJ W d    n1 s|0    Y  d S )Nr   )r&   ignorei        )r&   warningscatch_warningssimplefilterrS   
isinstance)r&   r[   r	   r	   r
   test_datetime   s    
$r_   c                  C  s^   dd l } |  : | dt ttjg dddtjs<J W d    n1 sP0    Y  d S )Nr   rX   )rY   rZ      ZSparse)Zdtype)r[   r\   r]   rS   r^   rK   r2   r/   )r[   r	   r	   r
   test_sparsearray  s    
ra   c                  C  sj   dd l } dd l}|  > | dt tjdd|ddk sHJ W d    n1 s\0    Y  d S )Nr   rX   
   )	r[   numpyr\   r]   rS   rK   r%   Zarangeall)r[   r%   r	   r	   r
   test_np  s
    
re   c                   @  s   e Zd Zg dZdd ZdS )TestApi)types
extensionsZindexersZinterchangec                 C  s   |  t| j d S rM   )r   r   allowed)r   r	   r	   r
   rL     s    zTestApi.test_apiN)r   r   r   ri   rL   r	   r	   r	   r
   rf     s   rf   c                   @  s4   e Zd Zg dZdd Zdd Zdd Zdd	 Zd
S )TestTesting)Zassert_frame_equalassert_series_equalZassert_index_equalZassert_extension_array_equalc                 C  s   ddl m} | || j d S )Nr   )r   )r#   r   r   rE   )r   r   r	   r	   r
   test_testing'  s    zTestTesting.test_testingc                 C  sp   t jdd  tt}dd l}W d    n1 s60    Y  dt|d jv sVJ dt|d jv slJ d S )Npandas.util.testingr   !pandas.util.testing is deprecatedpandas.testing instead)	sysr1   popr   rR   rS   pandas.util.testingstrmessage)r   mr#   r	   r	   r
   test_util_testing_deprecated,  s
    &z(TestTesting.test_util_testing_deprecatedc                 C  st   t jdd  tt}ddlm} W d    n1 s:0    Y  dt|d j	v sZJ dt|d j	v spJ d S )Nrm   r   )rk   rn   ro   )
rp   r1   rq   r   rR   rS   rr   rk   rs   rt   )r   ru   rk   r	   r	   r
   #test_util_testing_deprecated_direct6  s
    *z/TestTesting.test_util_testing_deprecated_directc                 C  sb   t jtjddgt jd }d|v s(J tjtdd t	j
j W d    n1 sT0    Y  d S )Nz-cz6import pandas; pandas.util.testing.assert_series_equal)stderrrn   foo)match)
subprocesscheck_outputrp   
executableSTDOUTdecodepytestZraisesAttributeErrorrK   r$   ry   )r   outr	   r	   r
   test_util_in_top_level?  s    
z"TestTesting.test_util_in_top_levelN)r   r   r   rE   rl   rv   rw   r   r	   r	   r	   r
   rj     s
   
	rj   )
__future__r   r{   rp   r   r#   rK   r   Zpandas._testingr?   r   r   r   r_   ra   re   rf   rj   r	   r	   r	   r
   <module>   s    _
