senapati484 commented on issue #77669:
URL: https://github.com/apache/airflow/issues/77669#issuecomment-7256924938

   The reproducer points to an inverse-mapping inconsistency: 
`RollupMapper.to_upstream(D)` defines a BACKWARD window as the half-open 
interval `(previous_period_start, period_start]`, but 
`to_downstream(upstream_key)` delegates to the upstream mapper and routes the 
boundary keys into the period that contains them. The two directions therefore 
disagree.
   
   Proposed solution:
   
   1. Make `RollupMapper.to_downstream()` honor the configured window direction 
and boundary semantics instead of delegating blindly to the upstream mapper.
   2. For BACKWARD windows, map a key at the period boundary to the downstream 
period whose `to_upstream()` set contains that key; preserve the existing 
FORWARD behavior.
   3. Add a parametrized test for Hour/Day/Week/Month/Quarter/Year windows with 
both directions, asserting the invariant:
      `upstream_key in window.to_upstream(D) == D in 
mapper.to_downstream(upstream_key)`.
   4. Add a scheduler-level regression test that produces all expected hourly 
events and verifies that exactly one pending DAG run is satisfied.
   
   Keeping the invariant test alongside the mapper unit tests should prevent 
the same boundary error from recurring in another window type.


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