From 7963f2db4302be6176f1bccd0b8dbbdf9f16a3aa Mon Sep 17 00:00:00 2001 From: Nok Date: Mon, 13 Nov 2023 06:42:15 +0000 Subject: [PATCH] Please linting --- pandera/api/pandas/array.py | 2 +- tests/core/test_pandas_config.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pandera/api/pandas/array.py b/pandera/api/pandas/array.py index 187b95b76..f9e86d503 100644 --- a/pandera/api/pandas/array.py +++ b/pandera/api/pandas/array.py @@ -3,7 +3,6 @@ import copy import warnings from typing import Any, List, Optional, TypeVar, Union, cast -from pandera.config import CONFIG import pandas as pd from pandera import errors @@ -12,6 +11,7 @@ from pandera.api.checks import Check from pandera.api.hypotheses import Hypothesis from pandera.api.pandas.types import CheckList, PandasDtypeInputTypes, is_field +from pandera.config import CONFIG from pandera.dtypes import DataType, UniqueSettings from pandera.engines import pandas_engine, PYDANTIC_V2 diff --git a/tests/core/test_pandas_config.py b/tests/core/test_pandas_config.py index f6b6ab277..f1c542379 100644 --- a/tests/core/test_pandas_config.py +++ b/tests/core/test_pandas_config.py @@ -1,16 +1,18 @@ """This module is to test the behaviour change based on defined config in pandera""" -# pylint:disable=import-outside-toplevel,abstract-method +# pylint:disable=import-outside-toplevel,abstract-method,redefined-outer-name -import pandera as pa -from pandera.config import CONFIG, ValidationDepth import pandas as pd -from pandera import DataFrameModel, DataFrameSchema, SeriesSchema import pytest +import pandera as pa +from pandera import DataFrameModel, DataFrameSchema, SeriesSchema +from pandera.config import CONFIG, ValidationDepth + @pytest.fixture() def disable_validation(): + """Fixture to disable validation and clean up after the test is finished""" CONFIG.validation_enabled = False yield "resource" CONFIG.validation_enabled = True @@ -22,7 +24,7 @@ class TestPandasDataFrameConfig: sample_data = pd.DataFrame( (("Bread", 9), ("Cutter", 15)), columns=["product", "price_val"] ) - + # pylint: disable=unused-argument def test_disable_validation(self, disable_validation): """This function validates that a none object is loaded if validation is disabled""" @@ -55,7 +57,7 @@ class TestPandasSeriesConfig: """Class to test all the different configs types""" sample_data = pd.Series([1, 1, 2, 2, 3, 3]) - + # pylint: disable=unused-argument def test_disable_validation(self, disable_validation): """This function validates that a none object is loaded if validation is disabled""" expected = {