From ee6722eaa452637665ad8a81b394f279884754f3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:52:01 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-core/examples/dev/app.py | 2 +- vizro-core/src/vizro/models/_components/_form.py | 2 +- vizro-core/src/vizro/models/_components/container.py | 2 +- vizro-core/src/vizro/models/_components/form/_alert.py | 2 +- vizro-core/src/vizro/models/_components/form/slider.py | 5 ++--- vizro-core/src/vizro/models/_components/tabs.py | 4 ++-- vizro-core/src/vizro/models/_controls/parameter.py | 2 +- vizro-core/src/vizro/models/_page.py | 2 +- vizro-core/src/vizro/models/types.py | 3 +-- .../tests/unit/vizro/models/_components/test_figure.py | 2 -- vizro-core/tests/unit/vizro/models/_components/test_graph.py | 2 -- 11 files changed, 11 insertions(+), 17 deletions(-) diff --git a/vizro-core/examples/dev/app.py b/vizro-core/examples/dev/app.py index 2ec9e12ee..958817c8f 100644 --- a/vizro-core/examples/dev/app.py +++ b/vizro-core/examples/dev/app.py @@ -1,7 +1,7 @@ """Example app to show all features of Vizro.""" from time import sleep -from typing import Literal, Optional +from typing import Optional import dash_bootstrap_components as dbc import pandas as pd diff --git a/vizro-core/src/vizro/models/_components/_form.py b/vizro-core/src/vizro/models/_components/_form.py index 93a6eb586..7236f1ead 100644 --- a/vizro-core/src/vizro/models/_components/_form.py +++ b/vizro-core/src/vizro/models/_components/_form.py @@ -12,7 +12,7 @@ from vizro.models import VizroBaseModel from vizro.models._components.form import Checklist, Dropdown, RadioItems, RangeSlider, Slider from vizro.models._layout import set_layout -from vizro.models._models_utils import _log_call, check_captured_callable, validate_min_length +from vizro.models._models_utils import _log_call, check_captured_callable from vizro.models.types import _FormComponentType if TYPE_CHECKING: diff --git a/vizro-core/src/vizro/models/_components/container.py b/vizro-core/src/vizro/models/_components/container.py index c89db29f5..115ee4775 100644 --- a/vizro-core/src/vizro/models/_components/container.py +++ b/vizro-core/src/vizro/models/_components/container.py @@ -11,7 +11,7 @@ # from pydantic import Field, validator from vizro.models import VizroBaseModel from vizro.models._layout import set_layout -from vizro.models._models_utils import _log_call, check_captured_callable, validate_min_length +from vizro.models._models_utils import _log_call, check_captured_callable from vizro.models.types import ComponentType if TYPE_CHECKING: diff --git a/vizro-core/src/vizro/models/_components/form/_alert.py b/vizro-core/src/vizro/models/_components/form/_alert.py index 112079c34..31170e857 100644 --- a/vizro-core/src/vizro/models/_components/form/_alert.py +++ b/vizro-core/src/vizro/models/_components/form/_alert.py @@ -3,11 +3,11 @@ import dash_bootstrap_components as dbc from dash import html from pydantic import Field + # try: # from pydantic.v1 import Field # except ImportError: # pragma: no cov # from pydantic import Field - from vizro.models import Action, VizroBaseModel from vizro.models._models_utils import _log_call diff --git a/vizro-core/src/vizro/models/_components/form/slider.py b/vizro-core/src/vizro/models/_components/form/slider.py index 17ebcf119..861b17477 100644 --- a/vizro-core/src/vizro/models/_components/form/slider.py +++ b/vizro-core/src/vizro/models/_components/form/slider.py @@ -1,13 +1,12 @@ from typing import Literal, Optional -from dash import ClientsideFunction, Input, Output, State, clientside_callback, dcc, html -from pydantic import Field, PrivateAttr, validator # try: # from pydantic.v1 import Field, PrivateAttr, validator # except ImportError: # pragma: no cov # from pydantic import Field, PrivateAttr, validator - import dash_bootstrap_components as dbc +from dash import ClientsideFunction, Input, Output, State, clientside_callback, dcc, html +from pydantic import Field, PrivateAttr, validator from vizro.models import Action, VizroBaseModel from vizro.models._action._actions_chain import _action_validator_factory diff --git a/vizro-core/src/vizro/models/_components/tabs.py b/vizro-core/src/vizro/models/_components/tabs.py index 5646ed7ee..a6982b8f3 100644 --- a/vizro-core/src/vizro/models/_components/tabs.py +++ b/vizro-core/src/vizro/models/_components/tabs.py @@ -3,14 +3,14 @@ from typing import TYPE_CHECKING, Literal import dash_bootstrap_components as dbc -from pydantic import conlist, validator +from pydantic import conlist # try: # from pydantic.v1 import validator # except ImportError: # pragma: no cov # from pydantic import validator from vizro.models import VizroBaseModel -from vizro.models._models_utils import _log_call, validate_min_length +from vizro.models._models_utils import _log_call if TYPE_CHECKING: from vizro.models._components import Container diff --git a/vizro-core/src/vizro/models/_controls/parameter.py b/vizro-core/src/vizro/models/_controls/parameter.py index 6fa0bd952..a8e17a453 100644 --- a/vizro-core/src/vizro/models/_controls/parameter.py +++ b/vizro-core/src/vizro/models/_controls/parameter.py @@ -1,7 +1,7 @@ from collections.abc import Iterable from typing import Annotated, Literal, cast -from pydantic import AfterValidator, Field, field_validator +from pydantic import AfterValidator, Field # try: # from pydantic.v1 import Field, validator diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index 31b03fc3d..558972d54 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -15,7 +15,7 @@ from vizro.models import Action, Filter, Layout, VizroBaseModel from vizro.models._action._actions_chain import ActionsChain, Trigger from vizro.models._layout import set_layout -from vizro.models._models_utils import _log_call, check_captured_callable, validate_min_length +from vizro.models._models_utils import _log_call, check_captured_callable from .types import ComponentType, ControlType diff --git a/vizro-core/src/vizro/models/types.py b/vizro-core/src/vizro/models/types.py index fb67e2ffb..91f06530b 100644 --- a/vizro-core/src/vizro/models/types.py +++ b/vizro-core/src/vizro/models/types.py @@ -12,9 +12,8 @@ import plotly.io as pio import pydantic_core as cs -from pydantic import Field, StrictBool, ValidationInfo, field_validator +from pydantic import Field, StrictBool, ValidationInfo from pydantic.fields import FieldInfo -from pydantic.json_schema import GetJsonSchemaHandler, JsonSchemaValue from typing_extensions import TypedDict from vizro.charts._charts_utils import _DashboardReadyFigure diff --git a/vizro-core/tests/unit/vizro/models/_components/test_figure.py b/vizro-core/tests/unit/vizro/models/_components/test_figure.py index fbcb55224..e72955c8c 100644 --- a/vizro-core/tests/unit/vizro/models/_components/test_figure.py +++ b/vizro-core/tests/unit/vizro/models/_components/test_figure.py @@ -5,14 +5,12 @@ import pytest from asserts import assert_component_equal from dash import dcc, html - from pydantic import ValidationError # try: # from pydantic.v1 import ValidationError # except ImportError: # pragma: no cov # from pydantic import ValidationError - import vizro.models as vm from vizro.figures import kpi_card from vizro.managers import data_manager diff --git a/vizro-core/tests/unit/vizro/models/_components/test_graph.py b/vizro-core/tests/unit/vizro/models/_components/test_graph.py index 810ee51cf..26514d797 100644 --- a/vizro-core/tests/unit/vizro/models/_components/test_graph.py +++ b/vizro-core/tests/unit/vizro/models/_components/test_graph.py @@ -7,14 +7,12 @@ from asserts import assert_component_equal from dash import dcc, html from dash.exceptions import MissingCallbackContextException - from pydantic import ValidationError # try: # from pydantic.v1 import ValidationError # except ImportError: # pragma: no cov # from pydantic import ValidationError - import vizro.models as vm import vizro.plotly.express as px from vizro.managers import data_manager