Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#985)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: huong-li-nguyen <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and huong-li-nguyen authored Feb 4, 2025
1 parent 91a8342 commit ec2170f
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
pass_filenames: false

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -45,15 +45,15 @@ repos:
args: [--autofix]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.4
hooks:
- id: ruff
args: [--fix]
exclude: "vizro-core/examples/scratch_dev/app.py"
- id: ruff-format

- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
rev: 1.8.2
hooks:
- id: bandit
args: [-c, pyproject.toml, -ll]
Expand Down Expand Up @@ -83,7 +83,7 @@ repos:
exclude: ^vizro-core/src/vizro/static/css/.+\.min.*|^vizro-core/src/vizro/static/css/mantine_dates.css

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.21
rev: 0.7.22
hooks:
- id: mdformat
args:
Expand Down
6 changes: 3 additions & 3 deletions tools/check_for_datafiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def check_for_data_files():
whitelisted_files = {files for dir in whitelist_dir for files in found_files if files.startswith(dir)}
to_be_removed_files = found_files - whitelisted_files

assert (
len(to_be_removed_files) == 0
), f"Caution! Please remove your data files {to_be_removed_files} before merging!"
assert len(to_be_removed_files) == 0, (
f"Caution! Please remove your data files {to_be_removed_files} before merging!"
)


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Removed
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Added
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Changed
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Deprecated
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Fixed
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Security
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
6 changes: 3 additions & 3 deletions vizro-ai/src/vizro_ai/plot/_response_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def _test_execute_chart_code(v, values):
f"Produced code execution failed the following error: <{e}>. Please check the code and try again, "
f"alternatively try with a more powerful model."
)
assert isinstance(
fig, go.Figure
), f"Expected chart code to return a plotly go.Figure object, but got {type(fig)}"
assert isinstance(fig, go.Figure), (
f"Expected chart code to return a plotly go.Figure object, but got {type(fig)}"
)
return v

return create_model(
Expand Down
2 changes: 1 addition & 1 deletion vizro-ai/src/vizro_ai/plot/_utils/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
".loadtxt",
".genfromtxt",
".load",
".fromfile" ".save",
".fromfile.save",
".savetxt",
".tofile",
".loadmat",
Expand Down
6 changes: 3 additions & 3 deletions vizro-ai/tests/e2e/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def logic( # noqa: PLR0912, PLR0915
pages_exist = [1 if dashboard.pages else 0]
pages_exist_report = bool(pages_exist[0])
pages_num = [1 if len(dashboard.pages) == len(config["pages"]) else 0]
pages_num_report = [f'{len(config["pages"])} page(s) for dashboard is {bool(pages_num[0])}']
pages_num_report = [f"{len(config['pages'])} page(s) for dashboard is {bool(pages_num[0])}"]

components_num = []
components_num_report = []
Expand All @@ -105,7 +105,7 @@ def logic( # noqa: PLR0912, PLR0915
components = 0
components_num.append(components)
components_num_report.append(
f'{len(config["pages"][page]["components"])} component(s) for page {page} is {bool(components)}'
f"{len(config['pages'][page]['components'])} component(s) for page {page} is {bool(components)}"
)

controls_num = []
Expand All @@ -117,7 +117,7 @@ def logic( # noqa: PLR0912, PLR0915
controls = 0
controls_num.append(controls)
controls_num_report.append(
f'{len(config["pages"][page]["controls"])} control(s) for page {page} is {bool(controls)}'
f"{len(config['pages'][page]['controls'])} control(s) for page {page} is {bool(controls)}"
)

components_types_names = []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Removed
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Added
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Changed
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Deprecated
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Fixed
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Security
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/models/_components/form/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TextArea(VizroBaseModel):
# Component properties for actions and interactions
_input_property: str = PrivateAttr("value")

# Re-used validators
# Reused validators
# TODO: Before making public, consider how actions should be triggered and what the default property should be
# See comment thread: https://github.com/mckinsey/vizro/pull/298#discussion_r1478137654
_set_actions = _action_validator_factory("value")
Expand Down
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/models/_components/form/checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Checklist(VizroBaseModel):
# Component properties for actions and interactions
_input_property: str = PrivateAttr("value")

# Re-used validators
# Reused validators
_validate_options = model_validator(mode="before")(validate_options_dict)

def __call__(self, options):
Expand Down
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/models/_components/form/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Dropdown(VizroBaseModel):
# Component properties for actions and interactions
_input_property: str = PrivateAttr("value")

# Re-used validators
# Reused validators
_validate_options = model_validator(mode="before")(validate_options_dict)

def __call__(self, options):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RadioItems(VizroBaseModel):
# Component properties for actions and interactions
_input_property: str = PrivateAttr("value")

# Re-used validators
# Reused validators
_validate_options = model_validator(mode="before")(validate_options_dict)

def __call__(self, options):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def test_one_parameter_per_target_multiple_attributes(

@pytest.mark.usefixtures("managers_one_page_two_graphs_with_dynamic_data")
@pytest.mark.parametrize(
"ctx_parameter_data_frame_argument, " "target_scatter_parameter_data_frame_first_n_last_n",
"ctx_parameter_data_frame_argument, target_scatter_parameter_data_frame_first_n_last_n",
[
((["scatter_chart"], {"first_n": 50}), {"first_n": 50}),
((["scatter_chart"], {"first_n": 50, "last_n": 50}), {"first_n": 50, "last_n": 50}),
Expand Down

0 comments on commit ec2170f

Please sign in to comment.