Harshil-1603 opened a new pull request, #26291:
URL: https://github.com/apache/datafusion/pull/26291

   ## Which issue does this PR close?
   
   Closes #16654.
   
   ## Rationale for this change
   
   API readers currently need to follow manually maintained links to discover 
complete runnable examples. Enable rustdoc's example scraping so the API 
reference displays real call sites next to the methods they demonstrate.
   
   ## What changes are included in this PR?
   
   - Enable example scraping for the published `datafusion` crate's docs.rs 
build.
   - Add a self-contained SQL and DataFrame query example, opt it into 
scraping, and include its source in the published package.
   - Document the local nightly build and the requirements for adding further 
scraped examples.
   
   This establishes scraping for the core crate. The separate 
`datafusion-examples` catalogue is not moved or bundled into the published 
library.
   
   ## What is the testing strategy for this PR?
   
   Passed locally on Rust 1.99.0, with nightly 1.101.0-nightly (2026-10-14) for 
rustdoc:
   
   - `cargo fmt --all -- --check`
   - `cargo clippy --locked -p datafusion --example query --all-features -- -D 
warnings`
   - `cargo run --locked -p datafusion --example query` (checks the SQL and 
DataFrame results against expected rows)
   - `cargo +nightly doc --locked -p datafusion --all-features --lib --no-deps 
-Z unstable-options -Z rustdoc-scrape-examples`, with `RUSTDOCFLAGS=-D warnings`
   - `cargo package --locked -p datafusion --allow-dirty --no-verify` and 
inspection of the resulting archive to confirm the example and scraping 
configuration are included
   - `./ci/scripts/doc_prettier_check.sh --write --allow-dirty`
   - `git diff --check`
   
   A normal nightly documentation build had no scraped example panels. With 
scraping enabled, the `SessionContext` and `DataFrame` pages contain 
source-linked panels from `query.rs`. The `SessionContext::sql` panel was 
inspected in a browser; no console errors were present (rustdoc produced 
font-preload warnings).
   
   The required full `cargo clippy --locked --all-targets --all-features -- -D 
warnings` fails with three existing `clippy::mutable_key_type` errors in 
unchanged `datafusion/optimizer/src/push_down_filter.rs`, tracked by #26181. 
The focused example check passes. The full lint suite and extended tests have 
not passed.
   
   ## Are there any user-facing changes?
   
   The API documentation now includes automatically extracted query examples 
and links to their source. No runtime behavior or public API changes.
   
   Prepared with Codex assistance. Author and maintainer review remain 
necessary; hosted docs.rs behavior will be verified after publication.
   
   @alamb Could you trigger CI for this first contribution?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to