RehanAhmad25 opened a new pull request, #69925:
URL: https://github.com/apache/airflow/pull/69925

    <!-- SPDX-License-Identifier: Apache-2.0
         https://www.apache.org/licenses/LICENSE-2.0 -->
   
   Closes: #69543
   
   ## What does this PR do?
   
   `TimeSensor` computed its target datetime in `__init__`, which runs at DAG 
parse time using `datetime.now(self.dag.timezone)`. When 
`start_from_trigger=True`, this value was stored directly in 
`start_trigger_args.trigger_kwargs`, which is serialized as part of the DAG. 
Because the value changed on every parse, the serialized DAG hash also changed 
on every parse, continuously creating new DAG versions.
   
   This PR:
   
   - Raises a `ValueError` when `start_from_trigger=True` is used with 
`TimeSensor`, since the target moment cannot be safely computed at parse time. 
`deferrable=True` remains fully supported and unaffected.
   - Changes `target_datetime` into a property that is computed on access 
instead of being fixed during `__init__`.
   - Updates the `TimeSensor` documentation to describe the actual behavior, 
which uses the current wall-clock time in the DAG's timezone, instead of the 
previously documented `data_interval_end`/`run_after`-relative behavior that 
was never implemented.
   
   
   


-- 
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]

Reply via email to