Skip to content

Commit

Permalink
Replace a few BLE noqas by config exclude
Browse files Browse the repository at this point in the history
Signed-off-by: Yury Fedotov <[email protected]>
  • Loading branch information
yury-fedotov committed Oct 23, 2024
1 parent 233cf2f commit 337cce6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package/kedro_viz/integrations/kedro/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def after_catalog_created(self, catalog: DataCatalog):
# Temporary try/except block so the Kedro develop branch can work with Viz.
try:
self.datasets = catalog._datasets
except Exception: # noqa: BLE001 # pragma: no cover
except Exception: # pragma: no cover
# Support for Kedro 0.18.x
self.datasets = catalog._data_sets # type: ignore[attr-defined]

Expand Down Expand Up @@ -92,7 +92,7 @@ def after_pipeline_run(self):
}
json.dump(sorted_stats_data, file)

except Exception as exc: # noqa: BLE001 # pragma: no cover
except Exception as exc: # pragma: no cover
logger.warning(
"Unable to write dataset statistics for the pipeline: %s", exc
)
Expand Down Expand Up @@ -128,7 +128,7 @@ def create_dataset_stats(self, dataset_name: str, data: Any):
dataset_name,
exc,
)
except Exception as exc: # noqa: BLE001 # pragma: no cover
except Exception as exc: # pragma: no cover
logger.warning(
"[hook: after_dataset_saved] Unable to create statistics for the dataset %s : %s",
dataset_name,
Expand All @@ -153,7 +153,7 @@ def get_file_size(self, dataset: Any) -> Union[int, None]:
)
return dataset._fs.size(file_path)

except Exception as exc: # noqa: BLE001
except Exception as exc:
logger.warning(
"Unable to get file size for the dataset %s: %s", dataset, exc
)
Expand Down
2 changes: 1 addition & 1 deletion package/kedro_viz/integrations/kedro/sqlite_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _to_json(self) -> str:
value["branch"] = branch.name
except ImportError as exc: # pragma: no cover
logger.warning("%s:%s", exc.__class__.__name__, exc.msg)
except Exception as exc: # noqa: BLE001 # pragma: no cover
except Exception as exc: # pragma: no cover
logger.warning("Something went wrong when fetching git metadata.")
logger.warning(exc)

Expand Down
3 changes: 2 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ ignore = [
"*/tests/*.py" = ["SLF", "D", "ARG"]
"package/kedro_viz/models/experiment_tracking.py" = ["SLF"]
"package/kedro_viz/models/flowchart.py" = ["SLF"]
"package/kedro_viz/integrations/kedro/hooks.py" = ["SLF"]
"package/kedro_viz/integrations/kedro/hooks.py" = ["SLF", "BLE"]
"package/kedro_viz/integrations/kedro/sqlite_store.py" = ["BLE"]
"package/kedro_viz/integrations/kedro/data_loader.py" = ["SLF"]
"package/kedro_viz/data_access/managers.py" = ["SLF"]
"package/kedro_viz/data_access/repositories/tracking_datasets.py" = ["SLF", "D"]
Expand Down

0 comments on commit 337cce6

Please sign in to comment.