|
1 | 1 | import json |
2 | 2 | import warnings |
3 | | -from collections.abc import Generator |
| 3 | +from collections.abc import Callable, Generator |
4 | 4 | from pathlib import Path |
5 | 5 | from unittest.mock import Mock |
6 | 6 |
|
@@ -31,7 +31,7 @@ def make_cluster_policy( |
31 | 31 | make_random, |
32 | 32 | log_workspace_link, |
33 | 33 | watchdog_purge_suffix, |
34 | | -) -> Generator[CreatePolicyResponse, None, None]: |
| 34 | +) -> Generator[Callable[..., CreatePolicyResponse], None, None]: |
35 | 35 | """ |
36 | 36 | Create a Databricks cluster policy and clean it up after the test. Returns a function to create cluster policies, |
37 | 37 | which returns `databricks.sdk.service.compute.CreatePolicyResponse` instance. |
@@ -63,7 +63,9 @@ def create(*, name: str | None = None, **kwargs) -> CreatePolicyResponse: |
63 | 63 |
|
64 | 64 |
|
65 | 65 | @fixture |
66 | | -def make_cluster(ws, make_random, log_workspace_link, watchdog_remove_after) -> Generator[ClusterDetails, None, None]: |
| 66 | +def make_cluster( |
| 67 | + ws, make_random, log_workspace_link, watchdog_remove_after |
| 68 | +) -> Generator[Callable[..., Wait[ClusterDetails]], None, None]: |
67 | 69 | """ |
68 | 70 | Create a Databricks cluster, waits for it to start, and clean it up after the test. |
69 | 71 | Returns a function to create clusters. You can get `cluster_id` attribute from the returned object. |
@@ -127,7 +129,7 @@ def make_instance_pool( |
127 | 129 | make_random, |
128 | 130 | log_workspace_link, |
129 | 131 | watchdog_remove_after, |
130 | | -) -> Generator[CreateInstancePoolResponse, None, None]: |
| 132 | +) -> Generator[Callable[..., CreateInstancePoolResponse], None, None]: |
131 | 133 | """ |
132 | 134 | Create a Databricks instance pool and clean it up after the test. Returns a function to create instance pools. |
133 | 135 | Use `instance_pool_id` attribute from the returned object to get an ID of the pool. |
@@ -169,7 +171,7 @@ def make_job( |
169 | 171 | make_workspace_file, |
170 | 172 | log_workspace_link, |
171 | 173 | watchdog_remove_after, |
172 | | -) -> Generator[Job, None, None]: |
| 174 | +) -> Generator[Callable[..., Job], None, None]: |
173 | 175 | """ |
174 | 176 | Create a Databricks job and clean it up after the test. Returns a function to create jobs, that returns |
175 | 177 | a `databricks.sdk.service.jobs.Job` instance. |
@@ -265,7 +267,7 @@ def make_pipeline( |
265 | 267 | make_notebook, |
266 | 268 | watchdog_remove_after, |
267 | 269 | watchdog_purge_suffix, |
268 | | -) -> Generator[CreatePipelineResponse, None, None]: |
| 270 | +) -> Generator[Callable[..., CreatePipelineResponse], None, None]: |
269 | 271 | """ |
270 | 272 | Create Delta Live Table Pipeline and clean it up after the test. Returns a function to create pipelines. |
271 | 273 | Results in a `databricks.sdk.service.pipelines.CreatePipelineResponse` instance. |
@@ -309,7 +311,9 @@ def create(**kwargs) -> CreatePipelineResponse: |
309 | 311 |
|
310 | 312 |
|
311 | 313 | @fixture |
312 | | -def make_warehouse(ws, make_random, watchdog_remove_after) -> Generator[Wait[GetWarehouseResponse], None, None]: |
| 314 | +def make_warehouse( |
| 315 | + ws, make_random, watchdog_remove_after |
| 316 | +) -> Generator[Callable[..., Wait[GetWarehouseResponse]], None, None]: |
313 | 317 | """ |
314 | 318 | Create a Databricks warehouse and clean it up after the test. Returns a function to create warehouses. |
315 | 319 |
|
|
0 commit comments