Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions libs/executors/garf/executors/entrypoints/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

"""FastAPI endpoint for executing queries."""

from __future__ import annotations

import pathlib
Expand Down Expand Up @@ -108,7 +109,7 @@ async def info() -> dict[str, str]:
@app.get('/api/fetchers')
async def get_fetchers() -> list[str]:
"""Shows all available API sources."""
return list(garf.executors.fetchers.find_fetchers())
return list(garf.executors.setup.find_executors())


@app.post('/api/execute')
Expand Down Expand Up @@ -177,7 +178,7 @@ def execute_workflow(
)
async def execute_workflow_task(
workflow_file: Optional[fastapi.UploadFile] = fastapi.File(None),
workflow_path: str | pathlib.Path = None,
workflow_path: str | pathlib.Path = None,
config_file: Optional[fastapi.UploadFile] = fastapi.File(None),
config_path: str | pathlib.Path = None,
selected_aliases: Optional[list[str]] = None,
Expand Down
7 changes: 4 additions & 3 deletions libs/executors/garf/executors/entrypoints/typer_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
TraceContextTextMapPropagator,
)
from rich.console import Console
from rich.table import Table
from typing_extensions import Annotated

LoggingInstrumentor().instrument(set_logging_format=False)
Expand All @@ -47,7 +48,7 @@

FetcherEnum = enum.Enum(
'FetcherEnum',
((f, f) for f in sorted(garf.executors.fetchers.find_fetchers())),
((f, f) for f in sorted(setup.find_executors())),
)

initialize_tracer()
Expand Down Expand Up @@ -385,8 +386,8 @@ def deploy(
@typer_app.command()
def fetchers() -> set[str]:
"""Displays all available fetchers."""
table = rich.table.Table('Fetcher')
for fetcher in garf.executors.fetchers.find_fetchers():
table = Table('Fetcher')
for fetcher in setup.find_executors():
table.add_row(fetcher)
console.print(table)

Expand Down
6 changes: 6 additions & 0 deletions libs/executors/garf/executors/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
logger = logging.getLogger('garf.executors.setup')


def find_executors() -> set[str]:
available_fetchers = fetchers.find_fetchers()
available_executors = {'bq', 'duckdb', 'opensearch', 'sqldb', 'elasticsearch'}
return sorted(available_fetchers | available_executors)


@tracer.start_as_current_span('executor.setup')
def setup_executor(
source: str,
Expand Down
Loading