Skip to content

Commit dd7d68c

Browse files
committed
[Python] Clarify rationale for mutator design
1 parent 491af65 commit dd7d68c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

experimental/python/databricks/bundles/core/_resource_mutator.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ def my_job_mutator(bundle: Bundle, job: Job) -> Job:
5151
Underling function that was decorated. Can be accessed for unit-testing.
5252
"""
5353

54+
# Below, we define decorators for each resource type. This approach allows us
55+
# to implement mutators that are only applied for specific resource types.
56+
#
57+
# Alternative approaches considered and rejected during design:
58+
#
59+
# - Inspecting type annotations without decorators.
60+
# Rationale: Avoid implicit runtime behavior changes based solely on type annotations,
61+
# especially if a function lacks an explicit decorator.
62+
#
63+
# - Using a universal @mutator decorator.
64+
# Rationale: Determining whether a mutator is invoked based solely on type annotations
65+
# was deemed overly implicit and potentially confusing.
5466

5567
@overload
5668
def job_mutator(

0 commit comments

Comments
 (0)