From 6096c8f4c8900a58cbf9fdfb4e6ec8d0be8b76fa Mon Sep 17 00:00:00 2001 From: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:28:50 -0400 Subject: [PATCH] Fix `node_link_json` type annotation (#1247) * Fix node_link_json type annotations * Add release notes * Try to fix link * Try to fix merge queue hanging --- .github/workflows/main.yml | 1 + .../notes/fix-node-link-json-stubs-eb745078ff1b9b8a.yaml | 6 ++++++ rustworkx/__init__.pyi | 4 ++-- rustworkx/rustworkx.pyi | 8 ++++---- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/fix-node-link-json-stubs-eb745078ff1b9b8a.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54408a314..d1797fe74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,7 @@ on: branches: [ main, 'stable/*' ] pull_request: branches: [ main, 'stable/*' ] + merge_group: concurrency: group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }} cancel-in-progress: true diff --git a/releasenotes/notes/fix-node-link-json-stubs-eb745078ff1b9b8a.yaml b/releasenotes/notes/fix-node-link-json-stubs-eb745078ff1b9b8a.yaml new file mode 100644 index 000000000..75eafe603 --- /dev/null +++ b/releasenotes/notes/fix-node-link-json-stubs-eb745078ff1b9b8a.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed a bug in the type hint for :func:`~rustworkx.node_link_json`. + Refer to `issue 1243 `__ for + more information. \ No newline at end of file diff --git a/rustworkx/__init__.pyi b/rustworkx/__init__.pyi index 390eef8cc..754c02f60 100644 --- a/rustworkx/__init__.pyi +++ b/rustworkx/__init__.pyi @@ -602,8 +602,8 @@ def node_link_json( graph: PyGraph[_S, _T] | PyDiGraph[_S, _T], path: str | None = ..., graph_attrs: Callable[[Any], dict[str, str]] | None = ..., - node_attrs: Callable[[_S], str] | None = ..., - edge_attrs: Callable[[_T], str] | None = ..., + node_attrs: Callable[[_S], dict[str, str]] | None = ..., + edge_attrs: Callable[[_T], dict[str, str]] | None = ..., ) -> str | None: ... def longest_simple_path(graph: PyGraph[_S, _T] | PyDiGraph[_S, _T]) -> NodeIndices | None: ... def isolates(graph: PyGraph[_S, _T] | PyDiGraph[_S, _T]) -> NodeIndices: ... diff --git a/rustworkx/rustworkx.pyi b/rustworkx/rustworkx.pyi index 37b3f0c5e..474472cf0 100644 --- a/rustworkx/rustworkx.pyi +++ b/rustworkx/rustworkx.pyi @@ -634,16 +634,16 @@ def digraph_node_link_json( /, path: str | None = ..., graph_attrs: Callable[[Any], dict[str, str]] | None = ..., - node_attrs: Callable[[_S], str] | None = ..., - edge_attrs: Callable[[_T], str] | None = ..., + node_attrs: Callable[[_S], dict[str, str]] | None = ..., + edge_attrs: Callable[[_T], dict[str, str]] | None = ..., ) -> str | None: ... def graph_node_link_json( graph: PyGraph[_S, _T], /, path: str | None = ..., graph_attrs: Callable[[Any], dict[str, str]] | None = ..., - node_attrs: Callable[[_S], str] | None = ..., - edge_attrs: Callable[[_T], str] | None = ..., + node_attrs: Callable[[_S], dict[str, str]] | None = ..., + edge_attrs: Callable[[_T], dict[str, str]] | None = ..., ) -> str | None: ... def parse_node_link_json( data: str,