dabla commented on code in PR #75272:
URL: https://github.com/apache/airflow/pull/75272#discussion_r4410900603


##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/msgraph.py:
##########
@@ -332,16 +352,42 @@ def push_page(
         """
         cursor = self.get_cursor(task_state_store)
         page = cursor["pages"] if cursor else 0
-        task_state_store.set(f"{PAGE_KEY_PREFIX}{page}", result)
+        task_state_store.set(f"{_PAGE_KEY_PREFIX}{page}", {"result": result})

Review Comment:
   Good catch, fixed in 8cda1781e2. The cursor now carries a `version` 
(15.3.0rc1 wrote none), checked in one place for both readers of the kept 
pages: `push_page` (a task deferred mid-pagination by rc1 resumes through 
`execute_complete`, not `execute`) and `pull_pages`. A cursor without the 
current version removes its pages and fails the try, so the next one starts 
from the first page; `execute` removes them and starts again directly in the 
same try.
   
   I went for the version rather than a new key namespace: new names would 
still need a legacy check in `push_page` (a resume from an rc1 trigger would 
otherwise start at page 0 and return pages with a hole), and they would leave 
the rc1 keys in the store until the retention expires. The regression test is 
parametrised over the page shape (list, dict with a `result` key) and the 
resume point (next page, last page), plus one for `execute`.



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