Skip to content

Commit

Permalink
make the lint rule consistent between the repos
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Oct 28, 2024
1 parent e22fae5 commit a3a338a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ select = [
"PD"
]
ignore = [
"E501",
# pydocstyle
"D107", # Missing docstring in __init__
"D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449
Expand All @@ -229,7 +228,7 @@ lines-between-types = 0
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"]
"errors.py" = ["D105"]
"tests/**.py" = ["D", "W505"]
"tests/**.py" = ["D"]

[tool.ruff.lint.pydocstyle]
convention = "google"
Expand Down
3 changes: 2 additions & 1 deletion sdmetrics/reports/base_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def generate(self, real_data, synthetic_data, metadata, verbose=True):
if not isinstance(metadata, dict):
raise TypeError(
f"Expected a dictionary but received a '{type(metadata).__name__}' instead."
" For SDV metadata objects, please use the 'to_dict' function to convert it to a dictionary."
" For SDV metadata objects, please use the 'to_dict' function to convert it"
' to a dictionary.'
)

self._validate(real_data, synthetic_data, metadata)
Expand Down
5 changes: 3 additions & 2 deletions sdmetrics/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,9 @@ def get_column_plot(real_data, synthetic_data, column_name, plot_type=None):
plot_type = 'bar'
elif plot_type == 'distplot' and column_is_constant:
raise ValueError(
f"Plot type 'distplot' cannot be created because column '{column_name}' has a constant value inside"
" the real or synthetic data. To render a visualization, please update the plot_type to 'bar'."
f"Plot type 'distplot' cannot be created because column '{column_name}'"
' has a constant value inside the real or synthetic data. To render a'
" visualization, please update the plot_type to 'bar'."
)

fig = _generate_column_plot(real_column, synthetic_column, plot_type)
Expand Down

0 comments on commit a3a338a

Please sign in to comment.