docs: document the supported sql.redshift dialect - #6159
Conversation
prql-bot
left a comment
There was a problem hiding this comment.
Self-review — the doc change matches support_level() and the guard works: I removed the sql.redshift bullet locally and test_target_dialects_documented failed with the expected diff, so it isn't passing vacuously.
One brittleness in the section parser, with an inline suggestion. Separately, the test's stated guarantee — the next dialect that ships undocumented fails CI — doesn't hold for a SupportLevel::Nascent dialect: it lands in neither actual() list, so an undocumented nascent dialect passes silently. No dialect is nascent today, so this is a latent gap rather than a bug; making actual exhaustive over Dialect::iter() (e.g. asserting the two documented lists together account for every variant) would close it.
|
Closed the Each dialect is grouped by the heading its support level maps to, and every group is asserted against the bullets under that heading, so a variant can't fall outside both lists. That also drops the VerificationTemporarily reclassifying Reverted; |
Dialect::Redshiftis classifiedSupportLevel::Supportedinsql/dialect.rs, has its ownRedshiftDialecthandler, and compiles today:But
sql.redshiftappears nowhere in the book —grep -rn redshift web/book/src/returns nothing. It's missing from both the Supported and Unsupported lists inproject/target.md, so a user reading the docs has no way to learn the dialect exists. Every otherDialectvariant is listed. This adds it to Supported, matchingsupport_level().Regression test. The two lists are a hand-maintained copy of
Dialect::support_level, which is exactly why they drifted.test_target_dialects_documentedparses the bullets out oftarget.mdand asserts they matchDialect::iter()partitioned by support level, so the next dialect that ships undocumented fails CI instead of going unnoticed. Confirmed it fails on the pre-fix doc:This follows the pattern of
test_date_format_specifiers_compileadded in #6140 — asserting a hand-written doc table against the implementation it describes.Notes
Found during the nightly rolling survey of
web/book/src/project/target.md.The test uses
strum::IntoEnumIterator, already a dependency ofmdbook-prql, andprqlc::sql::{Dialect, SupportLevel}, both already public. Thediscriminantcomparison is becauseSupportLeveldoesn't derivePartialEq; adding the derive to the public enum felt like a wider change than this fix warrants.SupportLevel::Nascentis declared and matched on intests/integration/queries.rs:60but never returned bysupport_level(), so no dialect is currently nascent and neither doc list covers it. Left alone.