ferruzzi commented on code in PR #57222: URL: https://github.com/apache/airflow/pull/57222#discussion_r2466861081
########## airflow-core/docs/howto/deadline-alerts.rst: ########## @@ -328,24 +328,95 @@ Custom References ^^^^^^^^^^^^^^^^^ While the built-in references should cover most use cases, and more will be released over time, you -can create custom references by implementing a class that inherits from DeadlineReference. This may -be useful if you have calendar integrations or other sources that you want to use as a reference. +can create custom references. This may be useful if you have calendar integrations or other sources +that you want to use as a reference. You can create custom references by implementing a class that +inherits from BaseDeadlineReference, give it am _evaluate_with() method, and register it. There are +two ways to accomplish this. The recommended way is to use the ``@deadline_reference`` decorator +but for more complicated implementations, the ``register_custom_reference()`` method is available. Review Comment: I can remove it, it was one of those "I can't think of why they'll want this, but it's a 'free' feature a this point" moments. I initially implemented the method before thinking the decorator would be a better experience, and maybe went fishing for a reason to leave it rather than refactor the method into the decorator entirely. How do you feel about leaving the code as-is but removing that part of the docs? I had a few other ideas like tying into regional calendar holidays and stuff, but I honestly don't know how likely it wold be to use then vs just making a MyRef-US, MyRef-CAN, etc. -- 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]
