Advertisement
Konark

Untitled

Feb 19th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. First iteration (the latest entry in the table, id = 45 696):
  2. prev_ending_date = None (since this is the start of the loop)
  3. delta_days is not calculated, as there is no prev_ending_date
  4. min_start_date = 2024-01-05
  5. max_end_date = 2024-01-20
  6. prev_ending_date is set to 2024-01-20
  7.  
  8. Second iteration (id = 45 603):
  9. prev_ending_date = 2024-01-20
  10. delta_days = 2023-10-31 - 2024-01-20 (a negative number, but we take this as a skip)
  11. min_start_date and max_end_date remain unchanged
  12. prev_ending_date is set to 2023-12-29
  13.  
  14. Third iteration (id = 45 497):
  15. prev_ending_date = 2023-12-29
  16. delta_days = 2023-10-28 - 2023-12-29 (a negative number, we skip)
  17. min_start_date and max_end_date remain unchanged
  18. prev_ending_date is set to 2023-12-31
  19.  
  20. Fourth iteration (id = 45 397):
  21. prev_ending_date = 2023-12-31
  22. Since the starting_date is the same as the previous entry, the results will be the same:
  23. delta_days = 2023-10-28 - 2023-12-31 (a negative number, we skip)
  24. min_start_date and max_end_date remain unchanged
  25. prev_ending_date remains 2023-12-31
  26.  
  27. Fifth iteration (id = 45 319):
  28. prev_ending_date = 2023-12-14
  29. delta_days = 2023-10-30 - 2023-12-14 (this will be a negative number, but for the logic of the loop, we consider this as a skip)
  30. min_start_date remains presumably 2023-10-27
  31. max_end_date remains presumably 2024-01-21
  32. prev_ending_date is set to 2023-12-14
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement