o
    Eh$                     @  s   d dl mZ d dlZd dlZd dlmZ d dlmZ d dl	m
ZmZmZmZmZ G dd dZG dd deZG d	d
 d
eZG dd deZdd ZdS )    )annotationsN)api)
extensionsindexersinterchangetypestypingc                   @  s   e Zd ZdddZdS )BaseNc                 C  sJ   t dd t|D }|d urt t|t| }t |}t|| d S )Nc                 s  s&    | ]}| d s|dkr|V  qdS )__r   N)
startswith).0f r   9lib/python3.10/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g dZg dZ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ejsPed dd Zdd Zdd ZdS )	TestPDApi)ZtestslocaleZconftestZ_version_meson)	r   arraysoptionstesttestingerrorsZplottingioZtseries)compatcorepandasutil_built_with_meson)Z
IndexSliceZNaTZNA)(Z
ArrowDtypeZCategoricalZCategoricalIndex	DataFrameZ
DateOffsetZDatetimeIndexZ	ExcelFileZExcelWriterZFlagsZGrouperZHDFStoreZIndexZ
MultiIndexZPeriodZPeriodIndexZ
RangeIndexZSeriesZSparseDtypeZStringDtypeZ	TimedeltaZTimedeltaIndexZ	TimestampZIntervalZIntervalIndexCategoricalDtypePeriodDtypeIntervalDtypeDatetimeTZDtypeZBooleanDtypeZ	Int8DtypeZ
Int16DtypeZ
Int32DtypeZ
Int64DtypeZ
UInt8DtypeZUInt16DtypeZUInt32DtypeZUInt64DtypeZFloat32DtypeZFloat64DtypeZNamedAggz	list[str]deprecated_classesmodules)ZarrayZbdate_rangeconcatZcrosstabZcutZ
date_rangeZinterval_rangeevalZ	factorizeZget_dummiesZfrom_dummiesZ
infer_freqZisnaZisnullZlreshapeZmeltZnotnaZnotnullZoffsetsZ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_optionZ
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_xmlZ	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)Zto_datetimeZ
to_numericZ	to_pickleZto_timedeltadeprecated_funcs_in_futuredeprecated_funcs)Z_configZ_libsZ_is_numpy_devZ_pandas_datetime_CAPIZ_pandas_parser_CAPI_testingZ_typingZ_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 || }|r7J d S r   )r   r9   r;   r2   r<   r=   r>   r?   r@   rA   r1   rC   __all__)r   r   ZactualZ
extraneousmissingr   r   r   test_api_all   s4   

zTestPDApi.test_api_allc              	   C  sT   | j | j | j }|D ]}tt tt|}W d    n1 s"w   Y  qd S r   )r1   r7   r6   r   assert_produces_warningFutureWarninggetattrrC   )r   Zdeprecated_listZdepr_r   r   r   	test_depr   s   zTestPDApi.test_deprN)r   r   r   r   r9   r:   r;   r<   r1   __annotations__r2   r=   r>   r?   r@   rA   r6   r7   rB   rC   r+   appendrD   rG   rL   r   r   r   r   r   !   s*   
 ,#
	
r   c                   @  sl   e Zd Zg dZg dZg dZddgZg dZg dZdd	 Z	d
d Z
dd Zdd Zdd Zdd ZdS )TestApi)r   r   r   r   r   )ZDataFrameGroupByZDatetimeIndexResamplerGroupbyZ	ExpandingZExpandingGroupbyZExponentialMovingWindowZExponentialMovingWindowGroupbyZ
JsonReaderZNaTTypeZNATypeZPeriodIndexResamplerGroupbyZ	ResamplerZRollingZRollingGroupbyZSeriesGroupByZStataReaderZTimedeltaIndexResamplerGroupbyZTimeGrouperZWindow).Zis_any_real_numeric_dtypeZis_array_likeZis_boolZis_bool_dtypeZis_categorical_dtypeZ
is_complexZis_complex_dtypeZis_datetime64_any_dtypeZis_datetime64_dtypeZis_datetime64_ns_dtypeZis_datetime64tz_dtypeZis_dict_likeZis_dtype_equalZis_extension_array_dtypeZis_file_likeZis_floatZis_float_dtypeZis_hashableZis_int64_dtype
is_integerZis_integer_dtypeZis_intervalZis_interval_dtypeZis_iteratorZis_list_likeZis_named_tupleZ	is_numberZis_numeric_dtypeZis_object_dtypeZis_period_dtypeZis_reZis_re_compilableZ	is_scalarZis_signed_integer_dtypeZ	is_sparseZis_string_dtypeZis_timedelta64_dtypeZis_timedelta64_ns_dtypeZis_unsigned_integer_dtypeZpandas_dtypeZinfer_dtypeZunion_categoricalsr-   r0   r/   r.   Zfrom_dataframer,   )Zcheck_array_indexerZBaseIndexerZFixedForwardWindowIndexerZVariableOffsetWindowIndexer)	Z
no_defaultZExtensionDtypeZregister_extension_dtypeZregister_dataframe_accessorZregister_index_accessorZregister_series_accessorZtakeZExtensionArrayZExtensionScalarOpsMixinc                 C     |  t| j d S r   )r   r   allowed_api_dirsr   r   r   r   rD   U     zTestApi.test_apic                 C  rQ   r   )r   
api_typingallowed_typingrS   r   r   r   test_api_typingX  rT   zTestApi.test_api_typingc                 C  rQ   r   )r   	api_typesallowed_api_typesrS   r   r   r   test_api_types[  rT   zTestApi.test_api_typesc                 C  rQ   r   )r   api_interchangeallowed_api_interchangerS   r   r   r   test_api_interchange^  rT   zTestApi.test_api_interchangec                 C  rQ   r   )r   api_indexersallowed_api_indexersrS   r   r   r   test_api_indexersa  rT   zTestApi.test_api_indexersc                 C  rQ   r   )r   api_extensionsallowed_api_extensionsrS   r   r   r   test_api_extensionsd  rT   zTestApi.test_api_extensionsN)r   r   r   rR   rV   rY   r\   r_   rb   rD   rW   rZ   r]   r`   rc   r   r   r   r   rO      s    0rO   c                   @  s$   e Zd Zg dZdd Zdd ZdS )TestTesting)Zassert_frame_equalZassert_series_equalZassert_index_equalZassert_extension_array_equalc                 C  s   ddl m} | || j d S )Nr   )r$   )r)   r$   r   r=   )r   r$   r   r   r   test_testingp  s   zTestTesting.test_testingc                 C  s<   t jtdd tjj W d    d S 1 sw   Y  d S )Nfoomatch)pytestZraisesAttributeErrorrC   r*   rf   rS   r   r   r   test_util_in_top_levelu  s   
"z"TestTesting.test_util_in_top_levelN)r   r   r   r=   re   rk   r   r   r   r   rd   h  s    rd   c                  C  sN   d} t jt| d tjj}W d    n1 sw   Y  |tjju s%J d S )Nz0PandasArray has been renamed NumpyExtensionArrayrg   )r   rH   rI   rC   r!   ZPandasArrayZNumpyExtensionArray)msgresr   r   r   test_pandas_array_aliasz  s
   
rn   )Z
__future__r   ri   r)   rC   r   Zpandas._testingr8   r   Z
pandas.apir   ra   r   r^   r   r[   r   rX   r   rU   r	   r   rO   rd   rn   r   r   r   r   <module>   s    	 Vr