Skip to content

Commit 8554f63

Browse files
committed
Fix formatting
1 parent 877427a commit 8554f63

File tree

12 files changed

+21
-26
lines changed

12 files changed

+21
-26
lines changed

graphdatascience/arrow_client/middleware/AuthMiddleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import base64
44
import time
5-
from typing import Optional, Any
5+
from typing import Any, Optional
66

77
from pyarrow._flight import ClientMiddleware, ClientMiddlewareFactory
88

@@ -60,4 +60,4 @@ def sending_headers(self) -> dict[str, str]:
6060
auth_token = f"{auth_pair[0]}:{auth_pair[1]}"
6161
auth_token = "Basic " + base64.b64encode(auth_token.encode("utf-8")).decode("ASCII")
6262
# There seems to be a bug, `authorization` must be lower key
63-
return {"authorization": auth_token}
63+
return {"authorization": auth_token}

graphdatascience/arrow_client/middleware/UserAgentMiddleware.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from pyarrow._flight import ClientMiddleware, ClientMiddlewareFactory
66

7+
78
class UserAgentFactory(ClientMiddlewareFactory): # type: ignore
89
def __init__(self, useragent: str, *args: Any, **kwargs: Any) -> None:
910
super().__init__(*args, **kwargs)
@@ -12,6 +13,7 @@ def __init__(self, useragent: str, *args: Any, **kwargs: Any) -> None:
1213
def start_call(self, info: Any) -> ClientMiddleware:
1314
return self._middleware
1415

16+
1517
class UserAgentMiddleware(ClientMiddleware): # type: ignore
1618
def __init__(self, useragent: str, *args: Any, **kwargs: Any) -> None:
1719
super().__init__(*args, **kwargs)
@@ -21,4 +23,4 @@ def sending_headers(self) -> dict[str, str]:
2123
return {"x-gds-user-agent": self._useragent}
2224

2325
def received_headers(self, headers: dict[str, Any]) -> None:
24-
pass
26+
pass

graphdatascience/arrow_client/v2/api_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from dataclasses import dataclass
22

3+
34
@dataclass(frozen=True, repr=True)
45
class JobIdConfig:
56
jobId: str
67

8+
79
@dataclass(frozen=True, repr=True)
810
class JobStatus:
911
jobId: str

graphdatascience/graph_data_science.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from pandas import DataFrame
1010

1111
from graphdatascience.arrow_client.arrow_authentication import UsernamePasswordAuthentication
12+
from graphdatascience.arrow_client.arrow_info import ArrowInfo
1213
from graphdatascience.procedure_surface.api.wcc_endpoints import WccEndpoints
1314
from graphdatascience.procedure_surface.cypher.wcc_proc_runner import WccCypherEndpoints
1415

1516
from .call_builder import IndirectCallBuilder
1617
from .endpoints import AlphaEndpoints, BetaEndpoints, DirectEndpoints
1718
from .error.uncallable_namespace import UncallableNamespace
1819
from .graph.graph_proc_runner import GraphProcRunner
19-
from graphdatascience.arrow_client.arrow_info import ArrowInfo
2020
from .query_runner.arrow_query_runner import ArrowQueryRunner
2121
from .query_runner.neo4j_query_runner import Neo4jQueryRunner
2222
from .query_runner.query_runner import QueryRunner

graphdatascience/query_runner/arrow_query_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
from pandas import DataFrame
77

88
from graphdatascience.arrow_client.arrow_authentication import ArrowAuthentication
9+
from graphdatascience.arrow_client.arrow_info import ArrowInfo
910
from graphdatascience.query_runner.query_mode import QueryMode
1011
from graphdatascience.retry_utils.retry_config import RetryConfig
1112

1213
from ..call_parameters import CallParameters
13-
from graphdatascience.arrow_client.arrow_info import ArrowInfo
1414
from ..server_version.server_version import ServerVersion
1515
from .arrow_graph_constructor import ArrowGraphConstructor
1616
from .gds_arrow_client import GdsArrowClient

graphdatascience/query_runner/gds_arrow_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
)
3737

3838
from graphdatascience.arrow_client.arrow_authentication import ArrowAuthentication, UsernamePasswordAuthentication
39+
from graphdatascience.arrow_client.arrow_info import ArrowInfo
3940
from graphdatascience.retry_utils.retry_config import RetryConfig
4041
from graphdatascience.retry_utils.retry_utils import before_log
4142

4243
from ..semantic_version.semantic_version import SemanticVersion
4344
from ..version import __version__
4445
from .arrow_endpoint_version import ArrowEndpointVersion
45-
from graphdatascience.arrow_client.arrow_info import ArrowInfo
4646

4747

4848
class GdsArrowClient:

graphdatascience/query_runner/protocol/project_protocols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def project_params(
2525
def run_projection(
2626
self,
2727
query_runner: QueryRunner,
28-
endpoint: str,
28+
query: str,
2929
params: CallParameters,
3030
terminationFlag: TerminationFlag,
3131
yields: Optional[list[str]] = None,

graphdatascience/session/aura_graph_data_science.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from pandas import DataFrame
66

77
from graphdatascience import QueryRunner, ServerVersion
8+
from graphdatascience.arrow_client.arrow_authentication import ArrowAuthentication
9+
from graphdatascience.arrow_client.arrow_info import ArrowInfo
810
from graphdatascience.call_builder import IndirectCallBuilder
911
from graphdatascience.endpoints import (
1012
AlphaRemoteEndpoints,
@@ -13,8 +15,6 @@
1315
)
1416
from graphdatascience.error.uncallable_namespace import UncallableNamespace
1517
from graphdatascience.graph.graph_remote_proc_runner import GraphRemoteProcRunner
16-
from graphdatascience.arrow_client.arrow_authentication import ArrowAuthentication
17-
from graphdatascience.arrow_client.arrow_info import ArrowInfo
1818
from graphdatascience.query_runner.arrow_query_runner import ArrowQueryRunner
1919
from graphdatascience.query_runner.gds_arrow_client import GdsArrowClient
2020
from graphdatascience.query_runner.neo4j_query_runner import Neo4jQueryRunner

graphdatascience/tests/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import pytest
77
from neo4j import Driver, GraphDatabase
88

9-
from graphdatascience.graph_data_science import GraphDataScience
109
from graphdatascience.arrow_client.arrow_authentication import UsernamePasswordAuthentication
10+
from graphdatascience.graph_data_science import GraphDataScience
1111
from graphdatascience.query_runner.neo4j_query_runner import Neo4jQueryRunner
1212
from graphdatascience.server_version.server_version import ServerVersion
1313
from graphdatascience.session.aura_graph_data_science import AuraGraphDataScience

graphdatascience/tests/unit/arrow_client/test_data_mapper.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Dict, Any
2+
from typing import Any, Dict
33

44
import pytest
55

@@ -22,12 +22,8 @@ class ExampleDataclass:
2222
"input_data, expected_output",
2323
[
2424
(
25-
{
26-
"field_one": "test",
27-
"field_two": 123,
28-
"nested": {"nested_field": 456}
29-
},
30-
ExampleDataclass("test", 123, NestedDataclass(456)),
25+
{"field_one": "test", "field_two": 123, "nested": {"nested_field": 456}},
26+
ExampleDataclass("test", 123, NestedDataclass(456)),
3127
),
3228
],
3329
)
@@ -37,12 +33,7 @@ def test_dict_to_dataclass(input_data: Dict[str, Any], expected_output: ExampleD
3733

3834

3935
def test_dict_to_dataclass_strict_mode_rejects_extra_fields():
40-
input_data = {
41-
"field_one": "test",
42-
"field_two": 123,
43-
"nested": {"nested_field": 456},
44-
"extra_field": "not_allowed"
45-
}
36+
input_data = {"field_one": "test", "field_two": 123, "nested": {"nested_field": 456}, "extra_field": "not_allowed"}
4637

4738
with pytest.raises(ValueError, match="Extra field 'extra_field' not allowed in ExampleDataclass"):
4839
DataMapper.dict_to_dataclass(input_data, ExampleDataclass, strict=True)

0 commit comments

Comments
 (0)