5
5
import pandas as pd
6
6
from pandas import api
7
7
import pandas ._testing as tm
8
- from pandas .api import typing as api_typing
8
+ from pandas .api import (
9
+ extensions as api_extensions ,
10
+ indexers as api_indexers ,
11
+ interchange as api_interchange ,
12
+ types as api_types ,
13
+ typing as api_typing ,
14
+ )
9
15
10
16
11
17
class Base :
@@ -237,7 +243,13 @@ def test_depr(self):
237
243
238
244
239
245
class TestApi (Base ):
240
- allowed = ["types" , "extensions" , "indexers" , "interchange" , "typing" ]
246
+ allowed_api_dirs = [
247
+ "types" ,
248
+ "extensions" ,
249
+ "indexers" ,
250
+ "interchange" ,
251
+ "typing" ,
252
+ ]
241
253
allowed_typing = [
242
254
"DataFrameGroupBy" ,
243
255
"DatetimeIndexResamplerGroupby" ,
@@ -256,13 +268,91 @@ class TestApi(Base):
256
268
"TimeGrouper" ,
257
269
"Window" ,
258
270
]
271
+ allowed_api_types = [
272
+ "is_any_real_numeric_dtype" ,
273
+ "is_array_like" ,
274
+ "is_bool" ,
275
+ "is_bool_dtype" ,
276
+ "is_categorical_dtype" ,
277
+ "is_complex" ,
278
+ "is_complex_dtype" ,
279
+ "is_datetime64_any_dtype" ,
280
+ "is_datetime64_dtype" ,
281
+ "is_datetime64_ns_dtype" ,
282
+ "is_datetime64tz_dtype" ,
283
+ "is_dict_like" ,
284
+ "is_dtype_equal" ,
285
+ "is_extension_array_dtype" ,
286
+ "is_file_like" ,
287
+ "is_float" ,
288
+ "is_float_dtype" ,
289
+ "is_hashable" ,
290
+ "is_int64_dtype" ,
291
+ "is_integer" ,
292
+ "is_integer_dtype" ,
293
+ "is_interval" ,
294
+ "is_interval_dtype" ,
295
+ "is_iterator" ,
296
+ "is_list_like" ,
297
+ "is_named_tuple" ,
298
+ "is_number" ,
299
+ "is_numeric_dtype" ,
300
+ "is_object_dtype" ,
301
+ "is_period_dtype" ,
302
+ "is_re" ,
303
+ "is_re_compilable" ,
304
+ "is_scalar" ,
305
+ "is_signed_integer_dtype" ,
306
+ "is_sparse" ,
307
+ "is_string_dtype" ,
308
+ "is_timedelta64_dtype" ,
309
+ "is_timedelta64_ns_dtype" ,
310
+ "is_unsigned_integer_dtype" ,
311
+ "pandas_dtype" ,
312
+ "infer_dtype" ,
313
+ "union_categoricals" ,
314
+ "CategoricalDtype" ,
315
+ "DatetimeTZDtype" ,
316
+ "IntervalDtype" ,
317
+ "PeriodDtype" ,
318
+ ]
319
+ allowed_api_interchange = ["from_dataframe" , "DataFrame" ]
320
+ allowed_api_indexers = [
321
+ "check_array_indexer" ,
322
+ "BaseIndexer" ,
323
+ "FixedForwardWindowIndexer" ,
324
+ "VariableOffsetWindowIndexer" ,
325
+ ]
326
+ allowed_api_extensions = [
327
+ "no_default" ,
328
+ "ExtensionDtype" ,
329
+ "register_extension_dtype" ,
330
+ "register_dataframe_accessor" ,
331
+ "register_index_accessor" ,
332
+ "register_series_accessor" ,
333
+ "take" ,
334
+ "ExtensionArray" ,
335
+ "ExtensionScalarOpsMixin" ,
336
+ ]
259
337
260
338
def test_api (self ):
261
- self .check (api , self .allowed )
339
+ self .check (api , self .allowed_api_dirs )
262
340
263
341
def test_api_typing (self ):
264
342
self .check (api_typing , self .allowed_typing )
265
343
344
+ def test_api_types (self ):
345
+ self .check (api_types , self .allowed_api_types )
346
+
347
+ def test_api_interchange (self ):
348
+ self .check (api_interchange , self .allowed_api_interchange )
349
+
350
+ def test_api_indexers (self ):
351
+ self .check (api_indexers , self .allowed_api_indexers )
352
+
353
+ def test_api_extensions (self ):
354
+ self .check (api_extensions , self .allowed_api_extensions )
355
+
266
356
267
357
class TestTesting (Base ):
268
358
funcs = [
0 commit comments