Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Development]

## [0.35.10 - 2025-01-24]

### Fixes:

* Spanner: better handling of spanner_config issues: #634, #644

## [0.35.9 - 2025-01-22]

### Docs
Expand Down
7 changes: 4 additions & 3 deletions graphistry/PlotterBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -2530,13 +2530,14 @@ def spanner_gql_to_g(self: Plottable, query: str) -> Plottable:
res = copy.copy(self)

if not hasattr(res, '_spannergraph'):
spanner_config = PyGraphistry._config["spanner"]
spanner_config = PyGraphistry._config.get("spanner", None)

if spanner_config is not None:
logger.debug(f"Spanner Config: {spanner_config}")
else:
raise ValueError('spanner_config is None, use spanner_init() or register() passing spanner_config')
raise ValueError('spanner_config not defined. Pass spanner_config via register() and retry query.')

res = res.spanner_init(PyGraphistry._config["spanner"]) # type: ignore[attr-defined]
res = res.spanner_init(spanner_config) # type: ignore[attr-defined]

return res._spannergraph.gql_to_graph(res, query)

Expand Down
3 changes: 2 additions & 1 deletion graphistry/plugins/spannergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def __connect(self) -> Any:
from google.cloud.spanner_dbapi.connection import connect

try:
if self.credentials_file:
if hasattr(self, 'credentials_file') and self.credentials_file is not None:

connection = connect(self.instance_id, self.database_id, credentials=self.credentials_file)
else:
connection = connect(self.instance_id, self.database_id)
Expand Down
Loading