Skip to content

Commit 19aaf49

Browse files
committed
Changelog and set_client_for
1 parent d914a62 commit 19aaf49

File tree

5 files changed

+45
-45
lines changed

5 files changed

+45
-45
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
77

88
## Dev
99

10+
## [0.39.0 - 2025-06-25]
11+
12+
### Added
13+
* Multi-tenant support: `graphistry.client()` and `graphistry.set_client_for()`
14+
* Global interface `PyGraphistry` class => Global `PyGraphistryClient` instance
15+
* `graphistry.client()` creates an independent `PyGraphistryClient` instance
16+
* Type annotations added, especially in PlotterBase.py, arrow_uploader.py, and pygraphistry.py
17+
18+
### Changed
19+
* Refactored Kusto and Spanner plugins:
20+
* Renamed `kustograph.py` to `kusto.py` for consistency
21+
* Renamed `spannergraph.py` to `spanner.py` for consistency
22+
* Improved configuration handling and error messages
23+
* Enhanced test coverage with new tests for client_session, kusto, and spanner modules
24+
25+
### Breaking 🔥
26+
* Plugin module renames: `graphistry.plugins.kustograph``graphistry.plugins.kusto` and `graphistry.plugins.spannergraph``graphistry.plugins.spanner`
27+
* Configuration for `Spanner` now uses `g.configure_spanner(...)` instead of `g.register(spanner_config={...})`
28+
* Configuration for `Kusto` now uses `g.configure_kusto(...)` instead of `g.register(kusto_config={...})`
29+
1030
## [0.38.3 - 2025-06-24]
1131

1232
### Fixed

demos/demos_databases_apis/spanner/google_spanner_finance_graph.ipynb

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@
121121
" protocol = \"https\", \n",
122122
" server = os.getenv(\"GRAPHISTRY_SERVER\"),\n",
123123
" username = os.getenv(\"GRAPHISTRY_USERNAME\"),\n",
124-
" password = os.getenv(\"GRAPHISTRY_PASSWORD\")\n",
125-
" )"
124+
" password = os.getenv(\"GRAPHISTRY_PASSWORD\"))"
126125
]
127126
},
128127
{
@@ -135,26 +134,19 @@
135134
},
136135
{
137136
"cell_type": "code",
138-
"execution_count": 4,
139-
"id": "1297168f",
137+
"execution_count": null,
138+
"id": "2e051930",
140139
"metadata": {},
141140
"outputs": [],
142141
"source": [
143-
"# Insert your Spanner configuration\n",
144142
"SPANNER_INSTANCE_ID = os.getenv(\"SPANNER_INSTANCE_ID\") or \"finance-graph-instance\"\n",
145143
"SPANNER_DATABASE_ID = os.getenv(\"SPANNER_DATABASE_ID\") or \"finance-graph-db\"\n",
146144
"\n",
147-
"# Service Account JSON Path -or- Project ID for interactive login\n",
148-
"SPANNER_SERVICE_ACCOUNT_JSON_PATH = os.getenv(\"SPANNER_SERVICE_ACCOUNT_JSON_PATH\") or \"path/to/credentials.json\"\n",
149-
"SPANNER_PROJECT_ID = os.getenv(\"SPANNER_PROJECT_ID\") or \"finance-graph-project\""
150-
]
151-
},
152-
{
153-
"cell_type": "markdown",
154-
"id": "bb895e0d-b2a4-474e-aba9-46f791ec9600",
155-
"metadata": {},
156-
"source": [
157-
"#### Google web-based auth below, only required if not using a credentials json file:"
145+
"# Option 1: Project ID is required for interactive login\n",
146+
"SPANNER_PROJECT_ID = os.getenv(\"SPANNER_PROJECT_ID\") or \"finance-graph-project\"\n",
147+
"\n",
148+
"# Option 2: use a service account key: \n",
149+
"# SPANNER_SERVICE_ACCOUNT_JSON_PATH = os.getenv(\"SPANNER_SERVICE_ACCOUNT_JSON_PATH\") or \"path/to/credentials.json\""
158150
]
159151
},
160152
{
@@ -165,17 +157,10 @@
165157
"outputs": [],
166158
"source": [
167159
"# Set the google project id for interactive login\n",
168-
"# !gcloud config set project {PROJECT_ID}\n",
169-
"# %env GOOGLE_CLOUD_PROJECT={PROJECT_ID}"
170-
]
171-
},
172-
{
173-
"cell_type": "code",
174-
"execution_count": null,
175-
"id": "f175d952-c1cc-4793-aad5-0cdb5142b6fe",
176-
"metadata": {},
177-
"outputs": [],
178-
"source": [
160+
"\n",
161+
"# !gcloud config set project {SPANNER_PROJECT_ID}\n",
162+
"# %env GOOGLE_CLOUD_PROJECT={SPANNER_PROJECT_ID}\n",
163+
"\n",
179164
"#!gcloud auth application-default login"
180165
]
181166
},
@@ -186,25 +171,22 @@
186171
"metadata": {},
187172
"outputs": [],
188173
"source": [
189-
"# Spanner can be configured with a credentials JSON or using gcloud auth application-default login (below)\n",
174+
"# Option 1: interactive login using gcloud auth application-default login (below)\n",
175+
"graphistry.configure_spanner(\n",
176+
" project_id=SPANNER_PROJECT_ID,\n",
177+
" instance_id=SPANNER_INSTANCE_ID,\n",
178+
" database_id=SPANNER_DATABASE_ID\n",
179+
")\n",
190180
"\n",
191181
"\n",
192-
"# Option 1: interactive login using gcloud auth application-default login (below)\n",
182+
"# Option 2: use a service account key: \n",
193183
"# graphistry.configure_spanner(\n",
194-
"# project_id=SPANNER_PROJECT_ID,\n",
195184
"# instance_id=SPANNER_INSTANCE_ID,\n",
196-
"# database_id=SPANNER_DATABASE_ID\n",
185+
"# database_id=SPANNER_DATABASE_ID,\n",
186+
"# credentials_file=SPANNER_SERVICE_ACCOUNT_JSON_PATH\n",
197187
"# )\n",
198188
"\n",
199189
"\n",
200-
"# Option 2: use a service account key: \n",
201-
"graphistry.configure_spanner(\n",
202-
" instance_id=SPANNER_INSTANCE_ID,\n",
203-
" database_id=SPANNER_DATABASE_ID,\n",
204-
" credentials_file=SPANNER_SERVICE_ACCOUNT_JSON_PATH\n",
205-
")\n",
206-
"\n",
207-
"\n",
208190
"\n",
209191
"# optional setting to limit the number of records returned\n",
210192
"LIMIT_CLAUSE = \"\"\n",

docs/source/plugins.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Graph
2323
* `Gremlin <https://tinkerpop.apache.org>`_ (:class:`graphistry.gremlin.GremlinMixin`)
2424
* `Memgraph <https://memgraph.com>`_ (:meth:`graphistry.PlotterBase.PlotterBase.cypher`)
2525
* `Neo4j <https://neo4j.com>`_ (:meth:`graphistry.PlotterBase.PlotterBase.cypher`)
26-
* `Google Spanner Graph <https://cloud.google.com/spanner/docs/graph/overview>`_ (:meth:`graphistry.PlotterBase.PlotterBase.spanner_gql_to_g`)
26+
* `Google Spanner Graph <https://cloud.google.com/spanner/docs/graph/overview>`_ (:meth:`graphistry.pygraphistry.PyGraphistry.spanner_gql`)
2727
* `TigerGraph <https://www.tigergraph.com>`_ (:meth:`graphistry.PlotterBase.PlotterBase.gsql`)
2828
* `Trovares <https://trovares.com>`_
2929

graphistry/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
description,
1616
bind,
1717
client,
18-
set_client,
18+
set_client_for,
1919
style,
2020
addStyle,
2121
edges,

graphistry/pygraphistry.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,6 @@ def register(
559559
:type certificate_validation: Optional[bool]
560560
:param bolt: Neo4j bolt information. Optional driver or named constructor arguments for instantiating a new one.
561561
:type bolt: Union[dict, Any]
562-
:param spanner_config: Spanner connection information. Named constructor arguments for instantiating a spanner client
563-
:type spanner_config: Union[dict, Any]
564562
:param protocol: Protocol used to contact visualization server, defaults to "https".
565563
:type protocol: Optional[str]
566564
:param token_refresh_ms: Ignored for now; JWT token auto-refreshed on plot() calls.
@@ -1753,7 +1751,7 @@ def client(self, inherit: bool = False) -> 'PyGraphistryClient':
17531751
new_client.session = self.session.copy()
17541752
return new_client
17551753

1756-
def set_client(self, plotter: Plotter) -> Plotter:
1754+
def set_client_for(self, plotter: Plotter) -> Plotter:
17571755
"""Set the client for a plotter.
17581756
17591757
:param plotter: Plotter to set the client for
@@ -2497,7 +2495,7 @@ def _handle_api_response(self, response):
24972495
description = PyGraphistry.description
24982496
bind = PyGraphistry.bind
24992497
client = PyGraphistry.client
2500-
set_client = PyGraphistry.set_client
2498+
set_client_for = PyGraphistry.set_client_for
25012499
edges = PyGraphistry.edges
25022500
nodes = PyGraphistry.nodes
25032501
pipe = PyGraphistry.pipe

0 commit comments

Comments
 (0)