wjddn279 commented on code in PR #56821:
URL: https://github.com/apache/airflow/pull/56821#discussion_r2453591002
##########
airflow-core/src/airflow/configuration.py:
##########
@@ -1248,6 +1249,48 @@ def getlist(self, section: str, key: str, delimiter=",",
**kwargs):
f'Current value: "{val}".'
)
+ E = TypeVar("E", bound=Enum)
Review Comment:
I got the idea for this implementation from [this
review](https://github.com/apache/airflow/pull/56821#discussion_r2442479331)
As you know, the main difference from the `get` function is that by
explicitly specifying the enum type when retrieving the configuration, the
compiler can provide a certain level of guarantee for the expected value or
it's combinations. This also removes the need for a separate filtering logic.
That said, I’m aware that this might be a bit over-engineered — it’s a
trade-off between type safety and simplicity, and in some cases it might feel
redundant.
I'd also like to hear @potiuk's thoughts on this!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]