Skip to content

Commit f237c1b

Browse files
committed
chore: establish public API
- re-exports in root-level __init__.py - removed the TaskFactory -> was not used anywhere JIRA: CQ-555
1 parent 81df716 commit f237c1b

File tree

3 files changed

+33
-23
lines changed

3 files changed

+33
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
11
# (C) 2024 GoodData Corporation
2+
3+
from gooddata_flight_server.config.config import (
4+
AuthenticationMethod,
5+
OtelConfig,
6+
OtelExporterType,
7+
ServerConfig,
8+
)
9+
from gooddata_flight_server.errors.error_code import ErrorCode
10+
from gooddata_flight_server.errors.error_info import ErrorInfo, RetryInfo
11+
from gooddata_flight_server.flexfun.flex_fun import FlexFun
12+
from gooddata_flight_server.health.server_health_monitor import ModuleHealthStatus, ServerHealthMonitor
13+
from gooddata_flight_server.server.auth.auth_middleware import TokenAuthMiddleware
14+
from gooddata_flight_server.server.auth.token_verifier import TokenVerificationStrategy
15+
from gooddata_flight_server.server.base import FlightServerMethodsFactory, ServerContext
16+
from gooddata_flight_server.server.flight_rpc.flight_middleware import (
17+
CallFinalizer,
18+
CallInfo,
19+
)
20+
from gooddata_flight_server.server.flight_rpc.server_methods import FlightServerMethods
21+
from gooddata_flight_server.tasks.base import TaskWaitTimeoutError
22+
from gooddata_flight_server.tasks.task import Task
23+
from gooddata_flight_server.tasks.task_error import TaskError
24+
from gooddata_flight_server.tasks.task_executor import (
25+
TaskExecutor,
26+
)
27+
from gooddata_flight_server.tasks.task_result import (
28+
FlightDataTaskResult,
29+
ListFlightsTaskResult,
30+
TaskExecutionResult,
31+
TaskResult,
32+
)

gooddata-flight-server/gooddata_flight_server/tasks/task.py

+1-23
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import threading
44
import uuid
55
from concurrent.futures import CancelledError
6-
from typing import Dict, List, Literal, Optional, Union, final
6+
from typing import Optional, Union, final
77

88
from gooddata_flight_server.tasks.task_error import TaskError
99
from gooddata_flight_server.tasks.task_result import TaskResult
@@ -191,25 +191,3 @@ def run(self) -> Union[TaskResult, TaskError]:
191191
:raise CancelledError: when the task's run was cancelled
192192
"""
193193
raise NotImplementedError
194-
195-
196-
class TaskFactory(abc.ABC):
197-
"""
198-
Interface for factories that create concrete implementations of tasks.
199-
"""
200-
201-
def create_task(
202-
self,
203-
cmd: bytes,
204-
headers: Dict[str, List[str]],
205-
method: Union[Literal["get-flight-info", "list-flights"], str] = "get-flight-info",
206-
) -> Task:
207-
"""
208-
Creates a new task to execute a particular command.
209-
210-
:param cmd: command included in the FlightDescriptor
211-
:param headers: headers provided with the request
212-
:param method: flight RPC method / action through which the request to create this task was invoked
213-
:return: new instance of task
214-
"""
215-
raise NotImplementedError

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ lint.ignore = [
3434
"gooddata-sdk/gooddata_sdk/__init__.py" = ["F401"]
3535
"gooddata-dbt/gooddata_dbt/__init__.py" = ["F401"]
3636
"gooddata-fdw/gooddata_fdw/__init__.py" = ["F401"]
37+
"gooddata-flight-server/gooddata_flight_server/__init__.py" = ["F401"]
3738

3839
[tool.ruff.format]
3940
exclude = ['(gooddata-api-client|.*\.snapshot\..*)']

0 commit comments

Comments
 (0)