Skip to content

Commit c216d2f

Browse files
feat: fix linting
1 parent 1681644 commit c216d2f

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎dataconnect/client.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
from __future__ import annotations
99

1010
from types import TracebackType
11-
12-
from dataconnect.models import Study
13-
from dataconnect.service import DataConnectService, DefaultDataConnectService
14-
1511
from uuid import UUID
1612

1713
import pandas as pd
1814

15+
from dataconnect.models import Study
16+
from dataconnect.service import DataConnectService, DefaultDataConnectService
17+
1918
_DEFAULT_HOST = "enodia-gateway.platform.imedidata.com"
2019
_DEFAULT_PORT = 443
2120

@@ -49,7 +48,7 @@ def connect(
4948
def get_studies(self) -> list[Study]:
5049
"""List the studies the client is authorized to access."""
5150
return self._service.get_studies()
52-
51+
5352
def fetch_data(
5453
self,
5554
dataset_uuid: UUID,

‎dataconnect/service/base.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
from abc import ABC, abstractmethod
66
from uuid import UUID
77

8+
import pandas as pd
9+
810
from dataconnect.models import Study
911

10-
import pandas as pd
1112

1213
class DataConnectService(ABC):
1314
"""Abstract service interface — defines all operations available to the client."""

‎dataconnect/service/default.py‎

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

33
from __future__ import annotations
44

5+
from uuid import UUID
6+
7+
import pandas as pd
8+
59
from dataconnect.exceptions import (
610
AuthenticationError,
711
AuthorizationError,
@@ -26,9 +30,6 @@
2630
TransportStatusError,
2731
)
2832
from dataconnect.transport.models import ResourceQuery
29-
from uuid import UUID
30-
31-
import pandas as pd
3233

3334
# Server action identifiers
3435
_ACTION_LIST_STUDIES = "studies.list"
@@ -95,7 +96,7 @@ def fetch_data(self, dataset_uuid: UUID, first_n_rows: int | None = None) -> pd.
9596
resources = self._transport.list_resources(request)
9697
except TransportError as ex:
9798
raise _translate_error(ex) from ex
98-
99+
99100
try:
100101
frames = [resource_to_fetched_data(r) for r in resources]
101102
except (IndexError, KeyError, TypeError, ValueError) as ex:
@@ -106,7 +107,6 @@ def fetch_data(self, dataset_uuid: UUID, first_n_rows: int | None = None) -> pd.
106107

107108
return pd.concat(frames, ignore_index=True)
108109

109-
110110
def close(self) -> None:
111111

112112
try:

‎dataconnect/service/mappers.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
from __future__ import annotations
99

1010
import json
11+
from uuid import UUID
12+
1113
import pandas as pd
1214
import pyarrow as pa
1315

14-
from uuid import UUID
15-
1616
from dataconnect.exceptions import NotFoundError
1717
from dataconnect.models import Study, StudyEnvironment
1818
from dataconnect.transport.models import ResourceInfo
@@ -32,6 +32,7 @@ def resource_to_study(resource: ResourceInfo) -> Study:
3232
environments=[StudyEnvironment(uuid=UUID(e["uuid"]), name=e["name"]) for e in data.get("environments", [])],
3333
)
3434

35+
3536
def resource_to_fetched_data(resource: ResourceInfo) -> pd.DataFrame:
3637
"""Parse a transport-layer ``ResourceInfo`` into pandas DataFrame.
3738

0 commit comments

Comments
 (0)