From 78828ce8b5d15104644eb3f7076f99a43f02dfc7 Mon Sep 17 00:00:00 2001 From: Exoutia Date: Sun, 2 Oct 2022 11:30:41 +0530 Subject: [PATCH 1/2] solved the pylint issue of "no self argument" --- pandas/tests/extension/decimal/test_decimal.py | 1 + pandas/tests/io/test_sql.py | 1 + pandas/tests/scalar/period/test_period.py | 1 + pyproject.toml | 1 - 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/tests/extension/decimal/test_decimal.py b/pandas/tests/extension/decimal/test_decimal.py index c2e42ae2fe27e..acba1bd557351 100644 --- a/pandas/tests/extension/decimal/test_decimal.py +++ b/pandas/tests/extension/decimal/test_decimal.py @@ -284,6 +284,7 @@ def test_compare_array(self, data, comparison_op): class DecimalArrayWithoutFromSequence(DecimalArray): """Helper class for testing error handling in _from_sequence.""" + @classmethod def _from_sequence(cls, scalars, dtype=None, copy=False): raise KeyError("For the test") diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 1bfb85f369415..2003e42881ae0 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -1613,6 +1613,7 @@ class _TestSQLAlchemy(SQLAlchemyMixIn, PandasSQLTest): flavor: str @pytest.fixture(autouse=True, scope="class") + @classmethod def setup_class(cls): cls.setup_import() cls.setup_driver() diff --git a/pandas/tests/scalar/period/test_period.py b/pandas/tests/scalar/period/test_period.py index c9e28f8249c1b..b5bd61854866d 100644 --- a/pandas/tests/scalar/period/test_period.py +++ b/pandas/tests/scalar/period/test_period.py @@ -840,6 +840,7 @@ def test_period_deprecated_freq(self): assert isinstance(p1, Period) assert isinstance(p2, Period) + @staticmethod def _period_constructor(bound, offset): return Period( year=bound.year, diff --git a/pyproject.toml b/pyproject.toml index 3e87d237170aa..02411464f5675 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,6 @@ disable = [ "no-member", "no-method-argument", "no-name-in-module", - "no-self-argument", "no-value-for-parameter", "non-iterator-returned", "not-an-iterable", From 9911c3e59bbfcc2b9566bb44b6f1e3ab90c4ecd4 Mon Sep 17 00:00:00 2001 From: Bibek Jha <94464106+Exoutia@users.noreply.github.com> Date: Sun, 2 Oct 2022 18:08:25 +0530 Subject: [PATCH 2/2] Update pandas/tests/io/test_sql.py Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com> --- pandas/tests/io/test_sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 2003e42881ae0..375f66d545ed4 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -1612,8 +1612,8 @@ class _TestSQLAlchemy(SQLAlchemyMixIn, PandasSQLTest): flavor: str - @pytest.fixture(autouse=True, scope="class") @classmethod + @pytest.fixture(autouse=True, scope="class") def setup_class(cls): cls.setup_import() cls.setup_driver()