Add PyDABs support for SQL Alerts - #6335
Conversation
| @@ -0,0 +1,19 @@ | |||
| from enum import Enum | |||
There was a problem hiding this comment.
This entire directory _models/ is autogenerated
| @@ -0,0 +1,123 @@ | |||
| __all__ = [ | |||
There was a problem hiding this comment.
This file is also auto generated
| @@ -12,6 +12,7 @@ | |||
| "VariableOrDict", | |||
There was a problem hiding this comment.
These had to be manually added to add mutators
| @@ -69,6 +70,38 @@ def my_job_mutator(bundle: Bundle, job: Job) -> Job: | |||
| # was deemed overly implicit and potentially confusing. | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
Again manually added but standard template code
| @@ -31,6 +31,7 @@ def all(cls) -> tuple["_ResourceType", ...]: | |||
| # intentionally lazily load all resource types to avoid imports from databricks.bundles.core to | |||
| # be imported in databricks.bundles.<resource_type> | |||
|
|
|||
There was a problem hiding this comment.
This file should also be autogenerated we should just have a cli interface where singular and plural can be defined
| @@ -249,6 +258,34 @@ def add_volume( | |||
|
|
|||
| self._volumes[resource_name] = volume | |||
|
|
|||
| def add_alert( | |||
There was a problem hiding this comment.
This is the only function that I'm not sure on whether to autogenerate or not??
| @@ -74,6 +83,40 @@ class TestCase: | |||
| ), | |||
| resource_types[Schema], | |||
| ), | |||
| ( | |||
There was a problem hiding this comment.
This is the unit test params that I think need to be manually written
| @@ -26,6 +34,7 @@ class TestCase: | |||
| dict_example: dict | |||
| dataclass_example: Resource | |||
| mutator: Callable | |||
| article: str = "a" # grammatical article in the duplicate-resource error message | |||
There was a problem hiding this comment.
Default article can be overriden for example in the case of alert
| @@ -21,6 +22,8 @@ | |||
| "pipelines", | |||
| "resources", | |||
| "catalog", | |||
| "sql", | |||
There was a problem hiding this comment.
These 2 had to be added manually but I think they can be found out using BFS and potentially stored in a yaml file
Integration test reportCommit: d3e7d64
Top 6 slowest tests (at least 2 minutes):
|
WIP