Skip to content

Commit bc16da9

Browse files
committed
Reduce comments
1 parent e31a311 commit bc16da9

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

python-wrapper/src/neo4j_viz/_gds_compat.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
"""Compatibility shims for the Neo4j GDS Python client.
2-
3-
Supports both the GDS 1.22 transitional API (graph operations exposed under the
4-
``gds.v2.*`` namespace, graph objects of type ``GraphV2``) and the GDS 2.0 API
5-
(the v2 endpoints became the default, so they live directly under ``gds.*`` and
6-
the graph class was renamed from ``GraphV2`` to ``Graph``).
7-
8-
The two APIs are selected by the installed client's major version, exposed via
9-
``graphdatascience.version.__version__``: major ``>= 2`` means the v2 endpoints
10-
are the default.
11-
"""
12-
131
from __future__ import annotations
142

153
import importlib
@@ -24,14 +12,8 @@ def _parse_major(version: str) -> int:
2412
return int(match.group(1)) if match else 0
2513

2614

27-
# In GDS 2.0 the (formerly ``v2``) endpoints became the default: graph operations moved
28-
# from ``gds.v2.*`` to ``gds.*`` and ``GraphV2`` was renamed to ``Graph``.
2915
IS_GDS_2: bool = _parse_major(_gds_version) >= 2
3016

31-
# The native graph class for the installed client version. Resolved dynamically (typed
32-
# ``Any``) because its import path differs between versions and only one path exists at a time.
33-
# ``_GRAPH_TYPES`` is the full set of graph objects accepted as input to ``from_gds``: on the
34-
# 1.22 transitional client we also accept the legacy v1 ``Graph`` (which is then converted).
3517
if IS_GDS_2:
3618
GdsGraph: Any = importlib.import_module("graphdatascience.graph").Graph
3719
_GRAPH_TYPES: tuple[type, ...] = (GdsGraph,)

0 commit comments

Comments
 (0)