Skip to content

[Python] Fix fileio file naming for windows outside the datetime range - #41916

Open
tvalentyn wants to merge 3 commits into
apache:masterfrom
tvalentyn:fix-fileio-naming-out-of-range-window
Open

tvalentyn wants to merge 3 commits into
apache:masterfrom
tvalentyn:fix-fileio-naming-out-of-range-window

Conversation

@tvalentyn

Copy link
Copy Markdown
Contributor

The default file naming of fileio.WriteToFiles converted window bounds to datetime, which only supports years 1 to 9999. Writing elements in windows outside of this range failed with "OverflowError: date value out of range".

Such windows are easy to get. GroupByKey and BatchElements (which RunInference and Enrichment use) give their outputs in the global window the timestamp of the end of the global window, which is in the year 294247.

Format such bounds like the bounds that datetime supports, with the actual year, for example 294247-01-09T04:00:00. The Java SDK also names files after the actual year of such bounds. Names of files for windows that datetime supports don't change.

fixes: #41914

The default file naming of fileio.WriteToFiles converted window bounds to
datetime, which only supports years 1 to 9999. Writing elements in windows
outside of this range failed with "OverflowError: date value out of range".

Such windows are easy to get. GroupByKey and BatchElements (which
RunInference and Enrichment use) give their outputs in the global window the
timestamp of the end of the global window, which is in the year 294247.

Format such bounds like the bounds that datetime supports, with the actual
year, for example 294247-01-09T04:00:00. The Java SDK also names files after
the actual year of such bounds. Names of files for windows that datetime
supports don't change.
@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.00%. Comparing base (bd3f5cc) to head (50150d9).
⚠️ Report is 23 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #41916      +/-   ##
============================================
+ Coverage     58.98%   59.00%   +0.01%     
  Complexity     2386     2386              
============================================
  Files          1137     1137              
  Lines        171425   171475      +50     
  Branches       1596     1596              
============================================
+ Hits         101121   101179      +58     
+ Misses        67733    67725       -8     
  Partials       2571     2571              
Flag Coverage Δ
python 80.86% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm added as fallback since no labels match configuration
Backup reviewer: jrmccluskey (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] fileio file naming for windows outside the datetime range fails

1 participant