Skip to content

Commit a79431e

Browse files
committed
Document option to specify auth
+ add links for own GDS types
1 parent 22ab792 commit a79431e

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

doc/modules/ROOT/pages/graph-analytics-serverless.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ sessions.get_or_create(
9494
|===
9595
| Name | Type | Optional | Default | Description
9696
| session_name | str | no | - | Name of the session. Must be unique within the project.
97-
| memory | SessionMemory | no | - | Amount of memory available to the session. https://neo4j.com/docs/graph-data-science-client/{docs-version}/api/sessions/session_memory[Supported values].
98-
| db_connection | DbmsConnectionInfo | yes | None | Bolt server URL, username, and password to a Neo4j DBMS. Required for the Attached and Self-managed types.
97+
| memory | https://neo4j.com/docs/graph-data-science-client/{docs-version}/api/sessions/session_memory[SessionMemory] | no | - | Amount of memory available to the session.
98+
| db_connection | https://neo4j.com/docs/graph-data-science-client/{docs-version}/api/sessions/DbmsConnectionInfo[DbmsConnectionInfo] | yes | None | Bolt server URL, username, and password to a Neo4j DBMS. Required for the Attached and Self-managed types. Alternatively to username and password, you can provide a `neo4j.Auth` https://neo4j.com/docs/python-manual/current/connect-advanced/#authentication-methods[object].
9999
| ttl | datetime.timedelta | yes | 1h | Time-to-live for the session.
100-
| cloud_location| CloudLocation | yes | None | Aura-supported cloud provider and region where the GDS Session will run. Required for the Self-managed and Standalone types.
100+
| cloud_location| https://neo4j.com/docs/graph-data-science-client/{docs-version}/api/sessions/cloud_location[CloudLocation] | yes | None | Aura-supported cloud provider and region where the GDS Session will run. Required for the Self-managed and Standalone types.
101101
| timeout | int | yes | None | Seconds to wait for the session to enter Ready state. If the time is exceeded, an error will be returned.
102102
|===
103103

@@ -198,7 +198,7 @@ sessions.delete(session_name="my-new-session")
198198
=== Estimating session memory
199199

200200
In order to help determine a good session size for a given workload, there is the `estimate()` function.
201-
By providing expected node and relationship counts as well as algorithm categories that should be used, it will return an estimated size of the session.
201+
By providing expected node and relationship counts as well as https://neo4j.com/docs/graph-data-science-client/{docs-version}/api/sessions/algorithm_category[algorithm categories] that should be used, it will return an estimated size of the session.
202202

203203
.Estimating the size of a GDS Session via the GdsSessions object:
204204
[source, python, role=no-test]
@@ -257,7 +257,7 @@ gds.graph.project(
257257
[opts="header",cols="1m,1m,4", role="no-break"]
258258
|===
259259
| Name | Type | Description
260-
| graph | Graph | Graph object representing the projected graph.
260+
| graph | https://neo4j.com/docs/graph-data-science-client/{docs-version}/api/graph_object[Graph] | Graph object representing the projected graph.
261261
| result | Series[Any] | Statistical data about the projection.
262262
|===
263263

graphdatascience/graph_data_science.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def __init__(
7979
if isinstance(endpoint, QueryRunner):
8080
self._query_runner = endpoint
8181
else:
82+
db_auth = None
8283
if auth:
8384
db_auth = neo4j.basic_auth(*auth)
8485
self._query_runner = Neo4jQueryRunner.create_for_db(

graphdatascience/tests/unit/session/test_dbms_connection_info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import neo4j
2+
23
from graphdatascience.session.dbms_connection_info import DbmsConnectionInfo
34

45

graphdatascience/tests/unit/test_dedicated_sessions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from datetime import datetime, timedelta, timezone
44
from typing import Optional, cast
55

6+
import neo4j
67
import pytest
78
from pytest_mock import MockerFixture
89

@@ -352,7 +353,7 @@ def test_create_attached_session(mocker: MockerFixture, aura_api: AuraApi) -> No
352353
assert gds_parameters == { # type: ignore
353354
"db_runner": {
354355
"endpoint": "neo4j+s://ffff0.databases.neo4j.io",
355-
"auth": ("dbuser", "db_pw"),
356+
"auth": neo4j.basic_auth("dbuser", "db_pw"),
356357
"aura_ds": True,
357358
"database": None,
358359
"show_progress": False,
@@ -396,7 +397,7 @@ def test_create_standalone_session(mocker: MockerFixture, aura_api: AuraApi) ->
396397
assert gds_credentials == { # type: ignore
397398
"db_runner": {
398399
"endpoint": "neo4j+s://foo.bar",
399-
"auth": ("dbuser", "db_pw"),
400+
"auth": neo4j.basic_auth("dbuser", "db_pw"),
400401
"aura_ds": True,
401402
"database": None,
402403
"show_progress": False,
@@ -444,7 +445,7 @@ def test_get_or_create(mocker: MockerFixture, aura_api: AuraApi) -> None:
444445
assert gds_args1 == { # type: ignore
445446
"db_runner": {
446447
"endpoint": "neo4j+s://ffff0.databases.neo4j.io",
447-
"auth": ("dbuser", "db_pw"),
448+
"auth": neo4j.basic_auth("dbuser", "db_pw"),
448449
"aura_ds": True,
449450
"database": None,
450451
"show_progress": False,

0 commit comments

Comments
 (0)