Skip to content

Commit 195530e

Browse files
committed
Format code
1 parent 3323248 commit 195530e

File tree

4 files changed

+11
-25
lines changed

4 files changed

+11
-25
lines changed

examples/dev/gds-sessions.ipynb

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -547,22 +547,8 @@
547547
}
548548
],
549549
"metadata": {
550-
"kernelspec": {
551-
"display_name": "Python 3",
552-
"language": "python",
553-
"name": "python3"
554-
},
555550
"language_info": {
556-
"codemirror_mode": {
557-
"name": "ipython",
558-
"version": 3
559-
},
560-
"file_extension": ".py",
561-
"mimetype": "text/x-python",
562-
"name": "python",
563-
"nbconvert_exporter": "python",
564-
"pygments_lexer": "ipython3",
565-
"version": "3.11.7"
551+
"name": "python"
566552
}
567553
},
568554
"nbformat": 4,

graphdatascience/gds_session/gds_sessions.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
)
1313
from graphdatascience.gds_session.aura_graph_data_science import AuraGraphDataScience
1414
from graphdatascience.gds_session.dbms_connection_info import DbmsConnectionInfo
15-
from graphdatascience.gds_session.session_sizes import SessionSizeByMemory
1615
from graphdatascience.gds_session.region_suggester import closest_match
16+
from graphdatascience.gds_session.session_sizes import SessionSizeByMemory
1717

1818

1919
@dataclass
@@ -59,7 +59,7 @@ def get_or_create(
5959
db_instance = self._aura_api.list_instance(db_instance_id)
6060
if not db_instance:
6161
raise ValueError(f"Could not find Aura instance with the uri `{db_connection.uri}`")
62-
62+
6363
region = self._ds_region(db_instance.region, db_instance.cloud_provider)
6464

6565
create_details = self._aura_api.create_instance(
@@ -137,8 +137,9 @@ def _ds_region(self, region: str, cloud_provider: str) -> str:
137137

138138
if not available_regions:
139139
raise ValueError(
140-
f"Tenant `{tenant_details.id}` cannot create GDS sessions at cloud provider `{cloud_provider}`.")
141-
140+
f"Tenant `{tenant_details.id}` cannot create GDS sessions at cloud provider `{cloud_provider}`."
141+
)
142+
142143
return closest_match(region, available_regions)
143144

144145
def _construct_client(
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from typing import List
1+
from typing import Iterable
2+
23
import textdistance
34

45

5-
def closest_match(query: str, options: List[str]) -> str:
6+
def closest_match(query: str, options: Iterable[str]) -> str:
67
if not options:
78
raise ValueError("No options to choose from.")
89

@@ -13,4 +14,4 @@ def closest_match(query: str, options: List[str]) -> str:
1314
closest_option = ep
1415
curr_max_similarity = similarity
1516

16-
return closest_option
17+
return closest_option

graphdatascience/tests/unit/test_gds_sessions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ def wait_for_instance_running(
8383
return super().wait_for_instance_running(instance_id, sleep_time=0.0001, max_sleep_time=0.001)
8484

8585
def tenant_details(self) -> TenantDetails:
86-
return TenantDetails(
87-
id=self._tenant_id, ds_type="fake-ds", regions_per_provider={"aws": {"leipzig-1"}}
88-
)
86+
return TenantDetails(id=self._tenant_id, ds_type="fake-ds", regions_per_provider={"aws": {"leipzig-1"}})
8987

9088

9189
@pytest.fixture

0 commit comments

Comments
 (0)