Skip to content

Conversation

@colinbarry
Copy link
Contributor

@colinbarry colinbarry commented Jul 18, 2025

Add support for ZonedDateTime types in query modules.

  • ZonedDateTime with a timezone (either numeric offset or named time identifier) can be passed to query modules.
  • Any datetimes returned by a Python query module will be converted into a ZonedDateTime if they have a valid timezone tzinfo, otherwise, they will be treated as LocalDateTimes.

@colinbarry colinbarry self-assigned this Jul 18, 2025
@colinbarry
Copy link
Contributor Author

colinbarry commented Jul 18, 2025

Tracking

  • [Link to Epic/Issue]

Standard development

CI Testing Labels

  • Select the appropriate CI test labels (CI -build=build-name -test=test-suite)

Documentation checklist

  • Add the documentation label
  • Add the bug / feature label
  • Add the milestone for which this feature is intended
    • If not known, set for a later milestone
  • Write a release note, including added/changed clauses
    • Added: Query modules now support timezone-aware datetime objects. This means your custom procedures and functions can now accept and return datetime values that include timezone information in either named IANA or numeric offset formats. #3121 #3200
    • docs: Add API reference for ZonedDateTime

@colinbarry colinbarry added the feature feature label Jul 18, 2025
@colinbarry colinbarry added this to the mg-v3.5.0 milestone Jul 18, 2025
@colinbarry colinbarry added CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=release -test=query_modules Run release build and query modules tests on push labels Jul 18, 2025
@colinbarry colinbarry force-pushed the feat/support-zoned-date-time-in-query-modules branch 2 times, most recently from 4e294eb to e82a209 Compare August 12, 2025 16:44
@colinbarry colinbarry added CI -build=coverage -test=core Run coverage build and core tests on push CI -build=community -test=core Run community build and core tests on push CI -build=jepsen -test=core Run jepsen build and core tests on push CI -build=debug -test=integration Run debug build and integration tests on push CI -build=release -test=stress Run release build and stress tests on push labels Aug 18, 2025
@colinbarry colinbarry force-pushed the feat/support-zoned-date-time-in-query-modules branch from 45eb563 to bafaaaf Compare August 18, 2025 13:16
@colinbarry colinbarry added the documentation documentation label Aug 18, 2025
@colinbarry colinbarry added community community CI -build=community -test=core Run community build and core tests on push CI -build=coverage -test=core Run coverage build and core tests on push CI -build=jepsen -test=core Run jepsen build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=stress Run release build and stress tests on push CI -build=release -test=query_modules Run release build and query modules tests on push labels Aug 20, 2025
@colinbarry colinbarry force-pushed the feat/support-zoned-date-time-in-query-modules branch from 99d4c4d to 1b420ab Compare August 20, 2025 08:33
@colinbarry colinbarry marked this pull request as ready for review August 20, 2025 08:42
@Josipmrden Josipmrden self-requested a review August 20, 2025 10:03
@colinbarry colinbarry requested a review from as51340 August 20, 2025 10:16
Copy link
Contributor

@as51340 as51340 left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link

@colinbarry colinbarry added this pull request to the merge queue Aug 20, 2025
Merged via the queue into master with commit cb186a6 Aug 20, 2025
30 of 31 checks passed
@colinbarry colinbarry deleted the feat/support-zoned-date-time-in-query-modules branch August 20, 2025 14:09
@gitbuda gitbuda added the Docs needed Docs needed label Aug 20, 2025
@gitbuda gitbuda mentioned this pull request Aug 20, 2025
81 tasks
github-merge-queue bot pushed a commit that referenced this pull request Aug 21, 2025
…3200)

`PyDateTime_DATE_GET_TZINFO` is only supported in Python 3.10 and above.
As we currently still support Python 3.9, this shim function does
exactly the same thing, without needing the macro.

Delivered as part of
[#3121](#3121)
as51340 pushed a commit that referenced this pull request Oct 24, 2025
Add support for `ZonedDateTime` types in query modules.

- `ZonedDateTime` with a timezone (either numeric offset or named time
identifier) can be passed to query modules.
- Any `datetime`s returned by a Python query module will be converted
into a `ZonedDateTime` if they have a valid `timezone` `tzinfo`,
otherwise, they will be treated as `LocalDateTime`s.
as51340 pushed a commit that referenced this pull request Oct 24, 2025
…3200)

`PyDateTime_DATE_GET_TZINFO` is only supported in Python 3.10 and above.
As we currently still support Python 3.9, this shim function does
exactly the same thing, without needing the macro.

Delivered as part of
[#3121](#3121)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI -build=community -test=core Run community build and core tests on push CI -build=coverage -test=core Run coverage build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=jepsen -test=core Run jepsen build and core tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=release -test=query_modules Run release build and query modules tests on push CI -build=release -test=stress Run release build and stress tests on push community community Docs needed Docs needed documentation documentation feature feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants