-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsync.pyi
More file actions
124 lines (111 loc) · 4.15 KB
/
sync.pyi
File metadata and controls
124 lines (111 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# mypy: disable-error-code="misc"
from contextlib import AbstractContextManager
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 GroupByParam, OrderByGroupBy, OrderByMetric, QueryParameters
from dbtsl.models import Dimension, Entity, EnvironmentInfo, Measure, SavedQuery, SyncMetric
from dbtsl.timeout import TimeoutOptions
class SyncSemanticLayerClient:
def __init__(
self,
environment_id: int,
auth_token: str,
host: str,
timeout: Optional[Union[TimeoutOptions, float, int]] = None,
lazy: bool = False,
) -> None: ...
@property
def lazy(self) -> bool:
"""Whether metadata queries will be lazy or not."""
...
@lazy.setter
def lazy(self, v: bool) -> None:
"""Set whether metadata queries will be lazy."""
...
@overload
def compile_sql(
self,
metrics: List[str],
group_by: Optional[List[str]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
@overload
def compile_sql(
self,
group_by: List[str],
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByGroupBy]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
@overload
def compile_sql(
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> str: ...
def compile_sql(self, **query_params: Unpack[QueryParameters]) -> str:
"""Get the compiled SQL that would be sent to the warehouse by a query."""
...
@overload
def query(
self,
metrics: List[str],
group_by: Optional[List[Union[GroupByParam, str]]] = None,
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
@overload
def query(
self,
group_by: List[Union[GroupByParam, str]],
limit: Optional[int] = None,
order_by: Optional[List[Union[str, OrderByGroupBy]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
@overload
def query(
self,
saved_query: str,
limit: Optional[int] = None,
order_by: Optional[List[Union[OrderByGroupBy, OrderByMetric]]] = None,
where: Optional[List[str]] = None,
read_cache: bool = True,
) -> "pa.Table": ...
async def query(self, **params: Unpack[QueryParameters]) -> "pa.Table":
"""Query the Semantic Layer."""
...
def metrics(self) -> List[SyncMetric]:
"""List all the metrics available in the Semantic Layer."""
...
def dimensions(self, metrics: List[str]) -> List[Dimension]:
"""List all the dimensions available for a given set of metrics."""
...
def dimension_values(self, metrics: List[str], group_by: str) -> List[str]:
"""List all the possible values for one or multiple metrics and a single dimension."""
...
def measures(self, metrics: List[str]) -> List[Measure]:
"""List all the measures available for a given set of metrics."""
...
def entities(self, metrics: List[str]) -> List[Entity]:
"""Get a list of all available entities for a given set of metrics."""
...
def saved_queries(self) -> List[SavedQuery]:
"""Get a list of all available saved queries."""
...
def environment_info(self) -> EnvironmentInfo:
"""Get information about the Semantic Layer environment."""
...
def session(self) -> AbstractContextManager[Iterator[Self]]:
"""Establish a connection with the dbt Semantic Layer's servers."""
...