docs: drop unsupported %k from date specifier table - #6140
Open
prql-bot wants to merge 1 commit into
Open
Conversation
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The date-specifier table in
web/book/src/reference/stdlib/date.mdis introduced as "the list of the specifiers currently supported", but%kis rejected by every dialect:chrono parses
%k(and%_H) asItem::Numeric(Numeric::Hour, Pad::Space), and no dialect'stranslate_chrono_iteminprqlc/prqlc/src/sql/dialect.rshas aPad::Spacearm —Pad::NoneandPad::Zeroare handled everywhere, so every space-padded specifier falls through to the unsupported-specifier error.Solution
Docs-side fix rather than implementing space padding: no target has a direct space-padding template (Postgres would need
LPAD(TO_CHAR(...), 2, ' ')rather than a format string, and MySQL's own%kis the no-pad hour, already used forPad::None), so implementing it is a design decision rather than a doc correction.%krow, and note under the table that space-padded specifiers aren't supported by any dialect — so someone coming from chrono's docs isn't left guessing.%-Hrow in its place. It is supported (TO_CHAR(col, 'FMHH24')on Postgres) but wasn't documented, even though the sibling%-mand%-drows are.Testing
Adds
test_date_format_specifiers_compileto the book documentation tests, which parses the specifier table out ofdate.mdand compiles each row againstsql.postgres. This is the durable part: the table can't silently drift from the dialect implementations again. It has a floor check on the row count so it can't pass vacuously if the table's formatting changes.Confirmed the test fails on
mainwith exactly one error (%k) and passes with the docs fix. Fullcargo test -p mdbook-prql --test documentationis green (6 passed).Note: #6138 also edits this table (a wrong
%-dexample) — different row, no overlap.Closes #6139 — automated triage