Skip to content

fix: group calendar time periods by UTC date - #96

Merged
hrodmn merged 2 commits into
developmentseed:mainfrom
earlybard:fix/utc-calendar-grouping
Nov 18, 2026
Merged

hrodmn merged 2 commits into
developmentseed:mainfrom
earlybard:fix/utc-calendar-grouping

Conversation

@earlybard

Copy link
Copy Markdown
Contributor

DuckDB returns timestamptz columns in the session time zone, which defaults to the system's. _build_time_steps hands those local timestamps to the groupers, and the day, week, month, year and fixed-day groupers slice the date straight off the string. On a non-UTC machine, items are grouped by their local date, but each step's datetime_filter still selects a UTC day in rustac. So an item whose local date differs from its UTC date ends up in the wrong step and then isn't read at all.

This parses the timestamp and takes its UTC date, as the exact and hourly groupers already do. Bare YYYY-MM-DD dates are unchanged.

To reproduce, on a machine in Australia/Sydney (or after SET TimeZone = 'Australia/Sydney' on the client), open two items either side of UTC midnight:

# datetimes 2023-01-15T23:59:50Z and 2023-01-16T00:00:10Z
lazycogs.open("items.parquet", ...).time.values
# before: ['2023-01-16'], with only the second item's pixels   after: ['2023-01-15', '2023-01-16']

We hit this on Geoscience Australia devboxes, which run in Canberra time. Landsat and Sentinel-2 pass over eastern Australia at around 00:00 UTC, so a large share of scenes went missing locally while the same code was fine on our UTC cluster.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the fix label Oct 28, 2026
DuckDB returns timestamptz columns in the session time zone, which defaults
to the system's. The day, week, month, year and fixed-day groupers sliced the
date off that string, so on a non-UTC machine items were grouped by local
date while each step's rustac filter still selected a UTC day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hrodmn
hrodmn force-pushed the fix/utc-calendar-grouping branch from 2bcb6c1 to 12aa486 Compare November 18, 2026 02:18

@hrodmn hrodmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @earlybard!

@hrodmn
hrodmn merged commit 6a6bd8a into developmentseed:main Nov 18, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants