Skip to content

Commit 625e792

Browse files
committed
refactor(gfql): keep schema accessor minimal
1 parent 73f301d commit 625e792

6 files changed

Lines changed: 10 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1010

1111
### Added
1212
- **GFQL schema effects (#1485)**: Added an internal typed schema-effect model for graph-growing GFQL calls so bound experimental `GraphSchema` snapshots are updated after successful degree, PageRank-style node-property writes, and edge-property write calls. Later local validation can see properties added by those calls without exposing a public `SchemaEffect` API or changing remote GFQL transport.
13-
- **GFQL schema accessor (#1632)**: Added experimental read-only `g.schema` and `g.has_schema()` accessors for inspecting a `GraphSchema` bound through `bind(schema=...)` without reaching into private `_gfql_schema` storage.
13+
- **GFQL schema accessor (#1632)**: Added experimental read-only `g.schema` for inspecting a `GraphSchema` bound through `bind(schema=...)` without reaching into private `_gfql_schema` storage.
1414
- **GFQL NetworkX CALL parity (#1058)**: Expanded the local Cypher `graphistry.nx.*` CALL surface with explicit NetworkX dispatch for `degree_centrality`, `closeness_centrality`, `eigenvector_centrality`, `katz_centrality`, `connected_components`, `strongly_connected_components`, `core_number`, and multi-output `hits`, including row and `.write()` coverage.
1515
- **NetworkX/SciPy optional dependency policy (#1618)**: Declared supported `networkx>=2.5,<4` and optional `scipy>=1.5,<2` ranges for NetworkX-backed GFQL CALL procedures, with runtime version guards and a focused lower/current-upper CI matrix.
1616
- **GFQL schema Arrow boundary APIs (#1339)**: Added experimental public schema↔Arrow import/export helpers, graph-level Arrow declaration payloads, and opt-in `schema_validate='strict'|'autofix'` enforcement for `plot()`, `upload()`, `to_arrow()`, and `validate_arrow_schema()` when a `GraphSchema` is bound.

docs/source/api/plotter.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ declared Arrow types after normal Arrow conversion. The default
2828
``schema_validate=False`` preserves existing behavior.
2929

3030
Use the experimental read-only ``g.schema`` accessor to inspect the bound
31-
``GraphSchema`` object, or ``g.has_schema()`` when only a predicate is needed.
32-
This reports only the local declaration attached through ``bind(schema=...)``:
33-
it does not infer a schema from data, fetch a remote dataset schema, or serialize
34-
the schema into ``gfql_remote()`` requests.
31+
``GraphSchema`` object. Check ``g.schema is not None`` when only a predicate is
32+
needed. This reports only the local declaration attached through
33+
``bind(schema=...)``: it does not infer a schema from data, fetch a remote
34+
dataset schema, or serialize the schema into ``gfql_remote()`` requests.
3535

3636
.. toctree::
3737
:maxdepth: 3

docs/source/gfql/schema.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ check against.
7474
7575
g.gfql_validate("MATCH (p:Person)-[:WORKS_AT]->(c:Company) RETURN p.name")
7676
assert g.schema is schema
77-
assert g.has_schema()
77+
assert g.schema is not None
7878
7979
Schema Objects
8080
--------------
@@ -98,10 +98,11 @@ Schema Objects
9898
makes schema-bound ``g.gfql_validate(...)`` permissive by default; callers can
9999
still override per call with ``g.gfql_validate(..., strict=True)``.
100100

101-
``g.schema`` and ``g.has_schema()``
101+
``g.schema``
102102
Read back the experimental ``GraphSchema`` bound with ``bind(schema=...)``.
103-
``g.schema`` returns the bound object or ``None``; ``g.has_schema()`` returns
104-
a matching boolean. Use ``bind(schema=...)`` to attach schemas, not assignment.
103+
``g.schema`` returns the bound object or ``None``. Use
104+
``g.schema is not None`` when only a predicate is needed. Use
105+
``bind(schema=...)`` to attach schemas, not assignment.
105106
This is local declaration introspection only. It does not infer schemas from
106107
data, fetch or hydrate remote dataset schemas, or serialize schemas into
107108
``gfql_remote()`` requests in this release.

graphistry/Plottable.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,6 @@ def copy(self) -> 'Plottable':
376376
def schema(self) -> Optional["GraphSchema"]:
377377
...
378378

379-
def has_schema(self) -> bool:
380-
...
381-
382379
# ### ComputeMixin
383380

384381
def get_indegrees(self, col: str = 'degree_in') -> 'Plottable':

graphistry/PlotterBase.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,10 +1806,6 @@ def schema(self) -> Optional["GraphSchema"]:
18061806
"""
18071807
return self._gfql_schema
18081808

1809-
def has_schema(self) -> bool:
1810-
"""Return ``True`` when this plotter has a local GFQL schema bound."""
1811-
return self._gfql_schema is not None
1812-
18131809
def copy(self) -> Plottable:
18141810
return copy.copy(self)
18151811

graphistry/tests/compute/gfql/test_public_schema.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ def test_bind_schema_is_chainable_and_used_by_preflight() -> None:
191191

192192
assert g._gfql_schema is schema
193193
assert g.schema is schema
194-
assert g.has_schema() is True
195194
report = g.gfql_validate("MATCH (p:Person)-[:WORKS_AT]->(c:Company) RETURN p.name AS name")
196195
assert report["ok"] is True
197196

@@ -201,7 +200,6 @@ def test_schema_accessor_returns_bound_schema() -> None:
201200
g = _graph(schema)
202201

203202
assert g.schema is schema
204-
assert g.has_schema() is True
205203

206204

207205
def test_schema_accessor_is_read_only() -> None:
@@ -218,7 +216,6 @@ def test_schema_accessor_returns_none_when_unbound() -> None:
218216
g = graphistry.bind()
219217

220218
assert g.schema is None
221-
assert g.has_schema() is False
222219

223220

224221
def test_bound_schema_arrow_boundary_strict_passes() -> None:

0 commit comments

Comments
 (0)