a
    oÝEb-   ã                   @  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|V  qdS )Ú__N)Ú
startswith)Ú.0Úf© r	   úY/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/pandas/tests/api/test_api.pyÚ	<genexpr>   ó    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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
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Úmiscr2   Ú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   rB   rD   r2   rE   rF   rG   rH   rI   rJ   r/   rL   Ú__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 rN   )
r(   r/   r1   r>   r=   r   Úassert_produces_warningÚFutureWarningÚgetattrrL   )r   Zdeprecated_listZdeprÚ_r	   r	   r
   Ú	test_deprê   s    ÿþýüÿzTestPDApi.test_deprN)r   r   r   r   rB   rC   r(   Ú__annotations__rD   rE   r/   r1   r2   rF   rG   rH   rI   rJ   r=   r>   rK   rM   rR   rW   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ÚsimplefilterrT   Ú
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   rY   )rZ   r[   é   ZSparse)Zdtype)r\   r]   r^   rT   r_   rL   r3   r0   )r\   r	   r	   r
   Útest_sparsearray  s    
rb   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   rY   é
   )	r\   Únumpyr]   r^   rT   rL   r&   ZarangeÚall)r\   r&   r	   r	   r
   Útest_np
  s
    
rf   c                   @  s   e Zd Zg d¢Zdd„ ZdS )ÚTestApi)ÚtypesÚ
extensionsZindexersc                 C  s   |   t| j¡ d S rN   )r   r   Úallowed)r   r	   r	   r
   rM     s    zTestApi.test_apiN)r   r   r   rj   rM   r	   r	   r	   r
   rg     s   rg   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   rF   )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)	Úsysr2   Úpopr   rS   rT   Ú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 )Nrn   r   )rl   ro   rp   )
rq   r2   rr   r   rS   rT   rs   rl   rt   ru   )r   rv   rl   r	   r	   r
   Ú#test_util_testing_deprecated_direct2  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)Ústderrro   Úfoo)Úmatch)Ú
subprocessÚcheck_outputrq   Ú
executableÚSTDOUTÚdecodeÚpytestZraisesÚAttributeErrorrL   r%   rz   )r   Úoutr	   r	   r
   Útest_util_in_top_level;  s    ýú
z"TestTesting.test_util_in_top_levelN)r   r   r   rF   rm   rw   rx   r„   r	   r	   r	   r
   rk     s
   
	rk   )Ú
__future__r   r|   rq   r�   r$   rL   r   Zpandas._testingr@   r   r   r   r`   rb   rf   rg   rk   r	   r	   r	   r
   Ú<module>   s    ]
