From 6c7c2dea565a4885896e35c481f5ac94f288ac0f Mon Sep 17 00:00:00 2001 From: Dawid Makar Date: Wed, 27 Sep 2023 02:36:03 +0200 Subject: [PATCH] Automatic refactoring. Refactoring step id: UUID('cdc57daa-b119-4d59-96b5-93997f95b184') --- pandas/tests/api/test_api.py | 98 ++---------------------------------- 1 file changed, 4 insertions(+), 94 deletions(-) diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 73713de08473b..5db0f3f22e549 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -5,13 +5,7 @@ import pandas as pd from pandas import api import pandas._testing as tm -from pandas.api import ( - extensions as api_extensions, - indexers as api_indexers, - interchange as api_interchange, - types as api_types, - typing as api_typing, -) +from pandas.api import typing as api_typing class Base: @@ -243,13 +237,7 @@ def test_depr(self): class TestApi(Base): - allowed_api_dirs = [ - "types", - "extensions", - "indexers", - "interchange", - "typing", - ] + allowed = ["types", "extensions", "indexers", "interchange", "typing"] allowed_typing = [ "DataFrameGroupBy", "DatetimeIndexResamplerGroupby", @@ -268,91 +256,13 @@ class TestApi(Base): "TimeGrouper", "Window", ] - allowed_api_types = [ - "is_any_real_numeric_dtype", - "is_array_like", - "is_bool", - "is_bool_dtype", - "is_categorical_dtype", - "is_complex", - "is_complex_dtype", - "is_datetime64_any_dtype", - "is_datetime64_dtype", - "is_datetime64_ns_dtype", - "is_datetime64tz_dtype", - "is_dict_like", - "is_dtype_equal", - "is_extension_array_dtype", - "is_file_like", - "is_float", - "is_float_dtype", - "is_hashable", - "is_int64_dtype", - "is_integer", - "is_integer_dtype", - "is_interval", - "is_interval_dtype", - "is_iterator", - "is_list_like", - "is_named_tuple", - "is_number", - "is_numeric_dtype", - "is_object_dtype", - "is_period_dtype", - "is_re", - "is_re_compilable", - "is_scalar", - "is_signed_integer_dtype", - "is_sparse", - "is_string_dtype", - "is_timedelta64_dtype", - "is_timedelta64_ns_dtype", - "is_unsigned_integer_dtype", - "pandas_dtype", - "infer_dtype", - "union_categoricals", - "CategoricalDtype", - "DatetimeTZDtype", - "IntervalDtype", - "PeriodDtype", - ] - allowed_api_interchange = ["from_dataframe", "DataFrame"] - allowed_api_indexers = [ - "check_array_indexer", - "BaseIndexer", - "FixedForwardWindowIndexer", - "VariableOffsetWindowIndexer", - ] - allowed_api_extensions = [ - "no_default", - "ExtensionDtype", - "register_extension_dtype", - "register_dataframe_accessor", - "register_index_accessor", - "register_series_accessor", - "take", - "ExtensionArray", - "ExtensionScalarOpsMixin", - ] def test_api(self): - self.check(api, self.allowed_api_dirs) + self.check(api, self.allowed) def test_api_typing(self): self.check(api_typing, self.allowed_typing) - def test_api_types(self): - self.check(api_types, self.allowed_api_types) - - def test_api_interchange(self): - self.check(api_interchange, self.allowed_api_interchange) - - def test_api_indexers(self): - self.check(api_indexers, self.allowed_api_indexers) - - def test_api_extensions(self): - self.check(api_extensions, self.allowed_api_extensions) - class TestTesting(Base): funcs = [ @@ -369,4 +279,4 @@ def test_testing(self): def test_util_in_top_level(self): with pytest.raises(AttributeError, match="foo"): - pd.util.foo + pd.util.foo \ No newline at end of file