Skip to content

Commit 00bef18

Browse files
committed
Update to the python client and documentation with updated DuckDB sensors.
1 parent adb0c21 commit 00bef18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+15451
-14467
lines changed

distribution/python/dqops/client/api/columns/get_columns.py

+41-1
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,40 @@
55

66
from ... import errors
77
from ...client import AuthenticatedClient, Client
8+
from ...models.check_type import CheckType
89
from ...models.column_list_model import ColumnListModel
9-
from ...types import Response
10+
from ...types import UNSET, Response, Unset
1011

1112

1213
def _get_kwargs(
1314
connection_name: str,
1415
schema_name: str,
1516
table_name: str,
17+
*,
18+
data_quality_status: Union[Unset, None, bool] = UNSET,
19+
check_type: Union[Unset, None, CheckType] = UNSET,
1620
) -> Dict[str, Any]:
1721
pass
1822

23+
params: Dict[str, Any] = {}
24+
params["dataQualityStatus"] = data_quality_status
25+
26+
json_check_type: Union[Unset, None, str] = UNSET
27+
if not isinstance(check_type, Unset):
28+
json_check_type = check_type.value if check_type else None
29+
30+
params["checkType"] = json_check_type
31+
32+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
33+
1934
return {
2035
"method": "get",
2136
"url": "api/connections/{connectionName}/schemas/{schemaName}/tables/{tableName}/columns".format(
2237
connectionName=connection_name,
2338
schemaName=schema_name,
2439
tableName=table_name,
2540
),
41+
"params": params,
2642
}
2743

2844

@@ -61,6 +77,8 @@ def sync_detailed(
6177
table_name: str,
6278
*,
6379
client: AuthenticatedClient,
80+
data_quality_status: Union[Unset, None, bool] = UNSET,
81+
check_type: Union[Unset, None, CheckType] = UNSET,
6482
) -> Response[List["ColumnListModel"]]:
6583
"""getColumns
6684
@@ -70,6 +88,8 @@ def sync_detailed(
7088
connection_name (str):
7189
schema_name (str):
7290
table_name (str):
91+
data_quality_status (Union[Unset, None, bool]):
92+
check_type (Union[Unset, None, CheckType]):
7393
7494
Raises:
7595
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -83,6 +103,8 @@ def sync_detailed(
83103
connection_name=connection_name,
84104
schema_name=schema_name,
85105
table_name=table_name,
106+
data_quality_status=data_quality_status,
107+
check_type=check_type,
86108
)
87109

88110
response = client.get_httpx_client().request(
@@ -98,6 +120,8 @@ def sync(
98120
table_name: str,
99121
*,
100122
client: AuthenticatedClient,
123+
data_quality_status: Union[Unset, None, bool] = UNSET,
124+
check_type: Union[Unset, None, CheckType] = UNSET,
101125
) -> Optional[List["ColumnListModel"]]:
102126
"""getColumns
103127
@@ -107,6 +131,8 @@ def sync(
107131
connection_name (str):
108132
schema_name (str):
109133
table_name (str):
134+
data_quality_status (Union[Unset, None, bool]):
135+
check_type (Union[Unset, None, CheckType]):
110136
111137
Raises:
112138
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -121,6 +147,8 @@ def sync(
121147
schema_name=schema_name,
122148
table_name=table_name,
123149
client=client,
150+
data_quality_status=data_quality_status,
151+
check_type=check_type,
124152
).parsed
125153

126154

@@ -130,6 +158,8 @@ async def asyncio_detailed(
130158
table_name: str,
131159
*,
132160
client: AuthenticatedClient,
161+
data_quality_status: Union[Unset, None, bool] = UNSET,
162+
check_type: Union[Unset, None, CheckType] = UNSET,
133163
) -> Response[List["ColumnListModel"]]:
134164
"""getColumns
135165
@@ -139,6 +169,8 @@ async def asyncio_detailed(
139169
connection_name (str):
140170
schema_name (str):
141171
table_name (str):
172+
data_quality_status (Union[Unset, None, bool]):
173+
check_type (Union[Unset, None, CheckType]):
142174
143175
Raises:
144176
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -152,6 +184,8 @@ async def asyncio_detailed(
152184
connection_name=connection_name,
153185
schema_name=schema_name,
154186
table_name=table_name,
187+
data_quality_status=data_quality_status,
188+
check_type=check_type,
155189
)
156190

157191
response = await client.get_async_httpx_client().request(**kwargs)
@@ -165,6 +199,8 @@ async def asyncio(
165199
table_name: str,
166200
*,
167201
client: AuthenticatedClient,
202+
data_quality_status: Union[Unset, None, bool] = UNSET,
203+
check_type: Union[Unset, None, CheckType] = UNSET,
168204
) -> Optional[List["ColumnListModel"]]:
169205
"""getColumns
170206
@@ -174,6 +210,8 @@ async def asyncio(
174210
connection_name (str):
175211
schema_name (str):
176212
table_name (str):
213+
data_quality_status (Union[Unset, None, bool]):
214+
check_type (Union[Unset, None, CheckType]):
177215
178216
Raises:
179217
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -189,5 +227,7 @@ async def asyncio(
189227
schema_name=schema_name,
190228
table_name=table_name,
191229
client=client,
230+
data_quality_status=data_quality_status,
231+
check_type=check_type,
192232
)
193233
).parsed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
from http import HTTPStatus
2+
from typing import Any, Dict, Optional, Union
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...types import Response
9+
10+
11+
def _get_kwargs(
12+
connection_name: str,
13+
year: int,
14+
month: int,
15+
incident_id: str,
16+
) -> Dict[str, Any]:
17+
pass
18+
19+
return {
20+
"method": "post",
21+
"url": "api/incidents/{connectionName}/{year}/{month}/{incidentId}/checks/disable".format(
22+
connectionName=connection_name,
23+
year=year,
24+
month=month,
25+
incidentId=incident_id,
26+
),
27+
}
28+
29+
30+
def _parse_response(
31+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
32+
) -> Optional[Any]:
33+
if response.status_code == HTTPStatus.NO_CONTENT:
34+
return None
35+
if client.raise_on_unexpected_status:
36+
raise errors.UnexpectedStatus(response.status_code, response.content)
37+
else:
38+
return None
39+
40+
41+
def _build_response(
42+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
43+
) -> Response[Any]:
44+
return Response(
45+
status_code=HTTPStatus(response.status_code),
46+
content=response.content,
47+
headers=response.headers,
48+
parsed=_parse_response(client=client, response=response),
49+
)
50+
51+
52+
def sync_detailed(
53+
connection_name: str,
54+
year: int,
55+
month: int,
56+
incident_id: str,
57+
*,
58+
client: AuthenticatedClient,
59+
) -> Response[Any]:
60+
"""disableChecksForIncident
61+
62+
Disables all data quality checks that caused a given data quality incident.
63+
64+
Args:
65+
connection_name (str):
66+
year (int):
67+
month (int):
68+
incident_id (str):
69+
70+
Raises:
71+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
72+
httpx.TimeoutException: If the request takes longer than Client.timeout.
73+
74+
Returns:
75+
Response[Any]
76+
"""
77+
78+
kwargs = _get_kwargs(
79+
connection_name=connection_name,
80+
year=year,
81+
month=month,
82+
incident_id=incident_id,
83+
)
84+
85+
response = client.get_httpx_client().request(
86+
**kwargs,
87+
)
88+
89+
return _build_response(client=client, response=response)
90+
91+
92+
async def asyncio_detailed(
93+
connection_name: str,
94+
year: int,
95+
month: int,
96+
incident_id: str,
97+
*,
98+
client: AuthenticatedClient,
99+
) -> Response[Any]:
100+
"""disableChecksForIncident
101+
102+
Disables all data quality checks that caused a given data quality incident.
103+
104+
Args:
105+
connection_name (str):
106+
year (int):
107+
month (int):
108+
incident_id (str):
109+
110+
Raises:
111+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
112+
httpx.TimeoutException: If the request takes longer than Client.timeout.
113+
114+
Returns:
115+
Response[Any]
116+
"""
117+
118+
kwargs = _get_kwargs(
119+
connection_name=connection_name,
120+
year=year,
121+
month=month,
122+
incident_id=incident_id,
123+
)
124+
125+
response = await client.get_async_httpx_client().request(**kwargs)
126+
127+
return _build_response(client=client, response=response)

0 commit comments

Comments
 (0)