diff --git a/kedro-datasets/kedro_datasets/networkx/json_dataset.py b/kedro-datasets/kedro_datasets/networkx/json_dataset.py index 2a66d6928..f4d9851ac 100644 --- a/kedro-datasets/kedro_datasets/networkx/json_dataset.py +++ b/kedro-datasets/kedro_datasets/networkx/json_dataset.py @@ -59,10 +59,10 @@ def __init__( # noqa: PLR0913 filepath: Filepath in POSIX format to the NetworkX graph JSON file. load_args: Arguments passed on to ``networkx.node_link_graph``. See the details in - https://networkx.org/documentation/networkx-1.9.1/reference/generated/networkx.readwrite.json_graph.node_link_graph.html + https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.json_graph.node_link_graph.html save_args: Arguments passed on to ``networkx.node_link_data``. See the details in - https://networkx.org/documentation/networkx-1.9.1/reference/generated/networkx.readwrite.json_graph.node_link_data.html + https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.json_graph.node_link_data.html version: If specified, should be an instance of ``kedro.io.core.Version``. If its ``load`` attribute is None, the latest version will be loaded. If its ``save`` diff --git a/kedro-datasets/pyproject.toml b/kedro-datasets/pyproject.toml index 96ad0fd41..67e8e38f9 100644 --- a/kedro-datasets/pyproject.toml +++ b/kedro-datasets/pyproject.toml @@ -24,7 +24,7 @@ s3fs-base = ["s3fs>=2021.4"] polars-base = ["polars>=0.18.0"] plotly-base = ["plotly>=4.8.0, <6.0"] delta-base = ["delta-spark>=1.0, <4.0"] -networkx-base = ["networkx~=2.4"] +networkx-base = ["networkx~=3.4"] # Individual Datasets api-apidataset = ["requests~=2.20"] @@ -228,8 +228,7 @@ test = [ "matplotlib>=3.5, <4.0", "memory_profiler>=0.50.0, <1.0", "moto==5.0.0", - "networkx~=2.4", - "numpy<2", + "networkx~=3.4", "openpyxl>=3.0.3, <4.0", "pandas-gbq>=0.12.0", "pandas>=2.0", diff --git a/kedro-datasets/tests/networkx/test_json_dataset.py b/kedro-datasets/tests/networkx/test_json_dataset.py index d61043126..c09660953 100644 --- a/kedro-datasets/tests/networkx/test_json_dataset.py +++ b/kedro-datasets/tests/networkx/test_json_dataset.py @@ -39,9 +39,7 @@ def versioned_json_dataset(filepath_json, load_version, save_version): @pytest.fixture def json_dataset_args(filepath_json): - return JSONDataset( - filepath=filepath_json, load_args={"attrs": ATTRS}, save_args={"attrs": ATTRS} - ) + return JSONDataset(filepath=filepath_json, load_args=ATTRS, save_args=ATTRS) @pytest.fixture() @@ -70,7 +68,14 @@ def test_load_args_save_args(self, mocker, json_dataset_args, dummy_graph_data): "networkx.node_link_data", wraps=networkx.node_link_data ) json_dataset_args.save(dummy_graph_data) - patched_save.assert_called_once_with(dummy_graph_data, attrs=ATTRS) + patched_save.assert_called_once_with( + dummy_graph_data, + source="from", + target="to", + name="fake_id", + key="fake_key", + link="fake_link", + ) patched_load = mocker.patch( "networkx.node_link_graph", wraps=networkx.node_link_graph @@ -91,7 +96,11 @@ def test_load_args_save_args(self, mocker, json_dataset_args, dummy_graph_data): {"from": 1, "to": 2}, ], }, - attrs=ATTRS, + source="from", + target="to", + name="fake_id", + key="fake_key", + link="fake_link", ) assert dummy_graph_data.nodes(data=True) == reloaded.nodes(data=True)