diff --git a/RELEASE.md b/RELEASE.md index 3ab55e08b4..bfb4d2d918 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -16,7 +16,9 @@ Please follow the established format: - Enhance kedro-viz doc integration. (#1874) - Fix Kedro-Viz waiting for valid Kedro project. (#1871) - Enhance Kedro-Viz documentation by using Kedro-sphinx-theme. (#1898) +- Remove default props from functional components. (#1906) - Fix for schema change in strawberry-graphql JSON scalar. (#1903) +- Fix messaging level when package compatibility is not satisfied. (#1904) # Release 9.0.0 diff --git a/demo-project/src/demo_project/requirements.in b/demo-project/src/demo_project/requirements.in index af486a91a6..dff89fa8d9 100644 --- a/demo-project/src/demo_project/requirements.in +++ b/demo-project/src/demo_project/requirements.in @@ -16,4 +16,4 @@ wheel>=0.35, <0.37 pillow~=9.0 matplotlib==3.5.0 pre-commit~=1.17 -seaborn~=0.11.2 +seaborn>=0.13.0 diff --git a/demo-project/src/docker_requirements.txt b/demo-project/src/docker_requirements.txt index 407cdfb038..5f220c35cf 100644 --- a/demo-project/src/docker_requirements.txt +++ b/demo-project/src/docker_requirements.txt @@ -2,4 +2,4 @@ kedro>=0.18.0 kedro-datasets[pandas.CSVDataset,pandas.ExcelDataset, pandas.ParquetDataset, plotly.PlotlyDataset, matplotlib.MatplotlibWriter]>=2.1.0 scikit-learn~=1.0 pillow~=9.0 -seaborn~=0.11.2 +seaborn>=0.13.0 diff --git a/docs/source/conf.py b/docs/source/conf.py index 1d3edbd09d..7a21f6e72e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -54,7 +54,7 @@ intersphinx_mapping = { "kedro": ("https://docs.kedro.org/en/stable/", None), - "kedro-datasets": ("https://docs.kedro.org/projects/kedro-datasets/en/kedro-datasets-1.7.1/", None), + "kedro-datasets": ("https://docs.kedro.org/projects/kedro-datasets/en/kedro-datasets-3.0.0/", None), } # -- Options for HTML output ------------------------------------------------- diff --git a/package/kedro_viz/api/rest/responses.py b/package/kedro_viz/api/rest/responses.py index 13aaa05a6d..7850d091ad 100644 --- a/package/kedro_viz/api/rest/responses.py +++ b/package/kedro_viz/api/rest/responses.py @@ -372,16 +372,17 @@ def get_selected_pipeline_response(registered_pipeline_id: str): def get_package_compatibilities_response( - package_requirements: Dict[str, str], + package_requirements: Dict[str, Dict[str, str]], ) -> List[PackageCompatibilityAPIResponse]: """API response for `/api/package_compatibility`.""" package_requirements_response = [] - for package_name, compatible_version in package_requirements.items(): + for package_name, package_info in package_requirements.items(): + compatible_version = package_info["min_compatible_version"] try: package_version = get_package_version(package_name) - except PackageNotFoundError as exc: - logger.exception("Failed to get package version. Error: %s", str(exc)) + except PackageNotFoundError: + logger.warning(package_info["warning_message"]) package_version = "0.0.0" is_compatible = packaging.version.parse( diff --git a/package/kedro_viz/constants.py b/package/kedro_viz/constants.py index 9afb7eddd4..620fa951e3 100644 --- a/package/kedro_viz/constants.py +++ b/package/kedro_viz/constants.py @@ -14,4 +14,14 @@ SHAREABLEVIZ_SUPPORTED_PLATFORMS = ["aws", "azure", "gcp"] -PACKAGE_REQUIREMENTS = {"fsspec": "2023.9.0", "kedro-datasets": "2.1.0"} +PACKAGE_REQUIREMENTS = { + "fsspec": { + "min_compatible_version": "2023.9.0", + "warning_message": "Publish and share Kedro-Viz requires fsspec >= 2023.9.0", + }, + "kedro-datasets": { + "min_compatible_version": "2.1.0", + "warning_message": "Experiment Tracking is exclusively supported " + "for users with kedro-datasets >= 2.1.0", + }, +} diff --git a/package/tests/test_api/test_rest/test_responses.py b/package/tests/test_api/test_rest/test_responses.py index 1842ee51f1..79c05092e4 100644 --- a/package/tests/test_api/test_rest/test_responses.py +++ b/package/tests/test_api/test_rest/test_responses.py @@ -1,4 +1,5 @@ # pylint: disable=too-many-lines +import logging import operator from pathlib import Path from typing import Any, Dict, Iterable, List @@ -7,7 +8,6 @@ import pytest from fastapi.testclient import TestClient -from importlib_metadata import PackageNotFoundError from kedro_viz.api import apps from kedro_viz.api.rest.responses import ( @@ -829,10 +829,30 @@ class TestPackageCompatibilities: @pytest.mark.parametrize( "package_name, package_version, package_requirements, expected_compatibility_response", [ - ("fsspec", "2023.9.1", {"fsspec": "2023.0.0"}, True), - ("fsspec", "2023.9.1", {"fsspec": "2024.0.0"}, False), - ("kedro-datasets", "2.1.0", {"kedro-datasets": "2.1.0"}, True), - ("kedro-datasets", "1.8.0", {"kedro-datasets": "2.1.0"}, False), + ( + "fsspec", + "2023.9.1", + {"fsspec": {"min_compatible_version": "2023.0.0"}}, + True, + ), + ( + "fsspec", + "2023.9.1", + {"fsspec": {"min_compatible_version": "2024.0.0"}}, + False, + ), + ( + "kedro-datasets", + "2.1.0", + {"kedro-datasets": {"min_compatible_version": "2.1.0"}}, + True, + ), + ( + "kedro-datasets", + "1.8.0", + {"kedro-datasets": {"min_compatible_version": "2.1.0"}}, + False, + ), ], ) def test_get_package_compatibilities_response( @@ -854,16 +874,27 @@ def test_get_package_compatibilities_response( assert package_response.package_version == package_version assert package_response.is_compatible is expected_compatibility_response - def test_get_package_compatibilities_exception_response( - self, - mocker, - ): - mocker.patch( - "kedro_viz.api.rest.responses.get_package_compatibilities_response", - side_effect=PackageNotFoundError("random-package"), - ) - package_name = "random-package" - response = get_package_compatibilities_response({package_name: "1.0.0"}) + def test_get_package_compatibilities_exception_response(self, caplog): + mock_package_requirement = { + "random-package": { + "min_compatible_version": "1.0.0", + "warning_message": "random-package is not available", + } + } + + with caplog.at_level(logging.WARNING): + response = get_package_compatibilities_response(mock_package_requirement) + + assert len(caplog.records) == 1 + + record = caplog.records[0] + + assert record.levelname == "WARNING" + assert ( + mock_package_requirement["random-package"]["warning_message"] + in record.message + ) + expected_response = PackageCompatibilityAPIResponse( package_name="random-package", package_version="0.0.0", is_compatible=False ) diff --git a/src/components/ui/button/button.js b/src/components/ui/button/button.js index 3bc486ce35..84f009a7ce 100644 --- a/src/components/ui/button/button.js +++ b/src/components/ui/button/button.js @@ -6,7 +6,14 @@ import './button.scss'; /** * Generic Kedro Button */ -const Button = ({ children, dataTest, disabled, onClick, size, mode }) => ( +const Button = ({ + children, + dataTest = 'TestDefaultDataValue', + disabled = false, + onClick, + size = 'regular', + mode = 'primary', +}) => (