Skip to content

Commit

Permalink
fixup! refactor: typing public interfaces with order by
Browse files Browse the repository at this point in the history
  • Loading branch information
serramatutu committed Oct 2, 2024
1 parent 88d6ed5 commit b40553c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions dbtsl/api/graphql/client/asyncio.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from typing import List, Optional, Self, Union
import pyarrow as pa
from typing_extensions import AsyncIterator, Unpack, overload

from dbtsl.api.shared.query_params import OrderByDimension, OrderByMetric, QueryParameters
from dbtsl.api.shared.query_params import OrderByGroupBy, OrderByMetric, QueryParameters
from dbtsl.models import (
Dimension,
Entity,
Expand Down Expand Up @@ -50,7 +50,7 @@ class AsyncGraphQLClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -59,7 +59,7 @@ class AsyncGraphQLClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -73,7 +73,7 @@ class AsyncGraphQLClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand All @@ -82,7 +82,7 @@ class AsyncGraphQLClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand Down
10 changes: 5 additions & 5 deletions dbtsl/api/graphql/client/sync.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from typing import Iterator, List, Optional, Union
import pyarrow as pa
from typing_extensions import Self, Unpack, overload

from dbtsl.api.shared.query_params import OrderByDimension, OrderByMetric, QueryParameters
from dbtsl.api.shared.query_params import OrderByGroupBy, OrderByMetric, QueryParameters
from dbtsl.models import (
Dimension,
Entity,
Expand Down Expand Up @@ -50,7 +50,7 @@ class SyncGraphQLClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -59,7 +59,7 @@ class SyncGraphQLClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -73,7 +73,7 @@ class SyncGraphQLClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand All @@ -82,7 +82,7 @@ class SyncGraphQLClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand Down
10 changes: 5 additions & 5 deletions dbtsl/client/asyncio.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from typing import AsyncIterator, List, Optional, Union
import pyarrow as pa
from typing_extensions import Self, Unpack, overload

from dbtsl.api.shared.query_params import OrderByDimension, OrderByMetric, QueryParameters
from dbtsl.api.shared.query_params import OrderByGroupBy, OrderByMetric, QueryParameters
from dbtsl.models import Dimension, Entity, Measure, Metric, SavedQuery

class AsyncSemanticLayerClient:
Expand All @@ -20,7 +20,7 @@ class AsyncSemanticLayerClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -29,7 +29,7 @@ class AsyncSemanticLayerClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -43,7 +43,7 @@ class AsyncSemanticLayerClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand All @@ -52,7 +52,7 @@ class AsyncSemanticLayerClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand Down
10 changes: 5 additions & 5 deletions dbtsl/client/sync.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from typing import Iterator, List, Optional, Union
import pyarrow as pa
from typing_extensions import Self, Unpack, overload

from dbtsl.api.shared.query_params import OrderByDimension, OrderByMetric, QueryParameters
from dbtsl.api.shared.query_params import OrderByGroupBy, OrderByMetric, QueryParameters
from dbtsl.models import Dimension, Entity, Measure, Metric, SavedQuery

class SyncSemanticLayerClient:
Expand All @@ -20,7 +20,7 @@ class SyncSemanticLayerClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -29,7 +29,7 @@ class SyncSemanticLayerClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
Expand All @@ -43,7 +43,7 @@ class SyncSemanticLayerClient:
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand All @@ -52,7 +52,7 @@ class SyncSemanticLayerClient:
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByDimension, OrderByMetric]]] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/test_sl_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from pytest_subtests import SubTests

from dbtsl import OrderByDimension
from dbtsl import OrderByGroupBy
from dbtsl.client.asyncio import AsyncSemanticLayerClient
from dbtsl.client.base import ADBC, GRAPHQL
from dbtsl.client.sync import SyncSemanticLayerClient
Expand Down Expand Up @@ -106,7 +106,7 @@ async def test_client_query_saved_query(api: str, client: BothClients) -> None:
table = await maybe_await(
client.query(
saved_query="order_metrics",
order_by=[OrderByDimension(name="metric_time", grain=None)],
order_by=[OrderByGroupBy(name="metric_time", grain=None)],
where=["1=1"],
limit=1,
read_cache=True,
Expand Down Expand Up @@ -140,7 +140,7 @@ async def test_client_compile_sql_saved_query(client: BothClients) -> None:
sql = await maybe_await(
client.compile_sql(
saved_query="order_metrics",
order_by=[OrderByDimension(name="metric_time", grain=None)],
order_by=[OrderByGroupBy(name="metric_time", grain=None)],
where=["1=1"],
limit=1,
read_cache=True,
Expand Down

0 comments on commit b40553c

Please sign in to comment.