Skip to content

fix: accept the documented DateTime format as input - #250

Draft
TwoDCube wants to merge 1 commit into
test/integrationfrom
fix/datetime-scalar-format
Draft

TwoDCube wants to merge 1 commit into
test/integrationfrom
fix/datetime-scalar-format

Conversation

@TwoDCube

Copy link
Copy Markdown
Member

Fixes a bug recorded by the tests in #246. Stacked on #247 (base test/integration), so this is a draft until #246 and #247 merge.

Bug

The DateTime scalar documents and emits the format YYYY-MM-DD HH:MM:SS, but parse used NaiveDateTime::from_str, which only accepts ISO 8601 with a T separator (YYYY-MM-DDTHH:MM:SS). A client sending back a value it had received got Wrong date format. No current query takes a DateTime argument, so nothing is broken for clients today.

Fix

Parse the documented format first and fall back to the ISO form, so inputs that worked before still work. parse and to_value now share one format constant.

Tests

  • parses_the_format_it_emits is no longer ignored, and parses_iso_8601_with_a_t_separator still passes.
  • cargo clippy --workspace --all-targets -D warnings is clean. CI=true cargo test --workspace passes against MySQL 8.4 and Redis 6.2.

🤖 Generated with Claude Code

The DateTime scalar documents and emits "YYYY-MM-DD HH:MM:SS", but parsed
input with NaiveDateTime::from_str, which only accepts the ISO 8601 form
with a "T" separator. Parse the documented format first and fall back to the
ISO form so existing inputs keep working.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@verseghy-prow

verseghy-prow Bot commented Sep 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TwoDCube

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@verseghy-prow verseghy-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant