diff --git a/Makefile b/Makefile index 00ce5cd3c2..b49c048e48 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,8 @@ pylint: cd package && isort black package/kedro_viz package/tests package/features pylint -j 0 --disable=bad-continuation,unnecessary-pass,ungrouped-imports package/kedro_viz - pylint -j 0 --disable=bad-continuation,missing-docstring,redefined-outer-name,no-self-use,invalid-name,too-few-public-methods,no-member package/tests - pylint -j 0 --disable=missing-docstring,no-name-in-module package/features + pylint -j 0 --disable=bad-continuation,missing-docstring,redefined-outer-name,no-self-use,invalid-name,too-few-public-methods,no-member,unused-argument package/tests + pylint -j 0 --disable=missing-docstring,no-name-in-module,unused-argument package/features flake8 package secret-scan: diff --git a/package/features/environment.py b/package/features/environment.py index 5e864293eb..a75ef22270 100644 --- a/package/features/environment.py +++ b/package/features/environment.py @@ -107,7 +107,7 @@ def _setup_context_with_venv(context, venv_dir): "pip>=20.0", "setuptools>=38.0", "wheel", - "botocore" + "botocore", ], env=context.env, ) diff --git a/package/kedro_viz/server.py b/package/kedro_viz/server.py index 47c99f6164..9257e3066d 100644 --- a/package/kedro_viz/server.py +++ b/package/kedro_viz/server.py @@ -538,8 +538,9 @@ def nodes_metadata(node_id): @app.errorhandler(404) -def resource_not_found(e): - return jsonify(error=str(e)), 404 +def resource_not_found(error): + """Returns HTTP 404 on resource not found.""" + return jsonify(error=str(error)), 404 def _get_task_metadata(node): @@ -642,7 +643,7 @@ def viz(host, port, browser, load_file, save_file, pipeline, env): raise KedroCliError(str(ex)) -# pylint: disable=too-many-arguments,too-many-branches +# pylint: disable=import-outside-toplevel,too-many-arguments,too-many-branches def _call_viz( host=None, port=None, @@ -663,13 +664,11 @@ def _call_viz( _DATA = _load_from_file(load_file) else: - # pylint: disable=import-outside-toplevel if KEDRO_VERSION.match(">=0.16.0"): from kedro.framework.context import KedroContextError else: - from kedro.context import ( # pylint: disable=no-name-in-module,import-error - KedroContextError, - ) + # pylint: disable=no-name-in-module,import-error + from kedro.context import KedroContextError try: if project_path is not None: diff --git a/package/tests/test_server.py b/package/tests/test_server.py index 57af4911f4..1ae79600fc 100644 --- a/package/tests/test_server.py +++ b/package/tests/test_server.py @@ -406,10 +406,7 @@ def test_node_metadata_endpoint_data_input(cli_runner, client, tmp_path): assert response.status_code == 200 data = json.loads(response.data.decode()) assert data["filepath"] == str(tmp_path) - assert ( - data["type"] - == f"{PickleDataSet.__module__}.{PickleDataSet.__qualname__}" - ) + assert data["type"] == f"{PickleDataSet.__module__}.{PickleDataSet.__qualname__}" @pytest.mark.usefixtures("patched_get_project_context") @@ -435,10 +432,7 @@ def test_node_metadata_endpoint_data_kedro15(cli_runner, client, tmp_path, mocke data = json.loads(response.data.decode()) assert data["filepath"] == str(tmp_path) - assert ( - data["type"] - == f"{PickleDataSet.__module__}.{PickleDataSet.__qualname__}" - ) + assert data["type"] == f"{PickleDataSet.__module__}.{PickleDataSet.__qualname__}" @pytest.mark.usefixtures("patched_get_project_context") @@ -454,7 +448,9 @@ def test_node_metadata_endpoint_parameters(cli_runner, client): @pytest.mark.usefixtures("patched_get_project_context") def test_node_metadata_endpoint_param_prefix(cli_runner, client): - """Test `/api/nodes/param_id` with param prefix endpoint is functional and returns an empty JSON.""" + """Test `/api/nodes/param_id` with param prefix endpoint is functional + and returns an empty JSON. + """ cli_runner.invoke(server.commands, ["viz", "--port", "8000"]) param_id = "c38d4c6a" response = client.get(f"/api/nodes/{param_id}")