Skip to content

[SPARK-59033][INFRA][DOCS] Coverage badges at branch root + fix udfs page rendering - #59

Closed
HyukjinKwon wants to merge 6 commits into
apache:masterfrom
HyukjinKwon:fix-coverage-badges
Closed

HyukjinKwon wants to merge 6 commits into
apache:masterfrom
HyukjinKwon:fix-coverage-badges

Conversation

@HyukjinKwon

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Publish the coverage badge JSON at the root of the badges branch
(coverage-rust.json, coverage-python.json) instead of inside a badges/
subdirectory.

Why are the changes needed?

The README shields.io endpoint badges read:

  • https://raw.githubusercontent.com/apache/spark-connect-rust/badges/coverage-rust.json
  • https://raw.githubusercontent.com/apache/spark-connect-rust/badges/coverage-python.json

i.e. files at the root of the badges branch. But coverage.yml copied them into a
badges/ subdirectory before committing, so the published path was
.../badges/badges/coverage-rust.json and the badges rendered as "resource not
found"
(404). This writes the JSON at the branch root so the endpoints resolve. It
takes effect on the next master push (the workflow publishes on push to master).

Does this PR introduce any user-facing change?

No — CI/badge publishing only.

How was this patch tested?

YAML validated; the publish step now cps the badge JSON to the branch root and
git adds the root files. Confirmed the README URLs point at the root paths.

This pull request and its description were written by Isaac.

…branch root

The README shields.io endpoints read .../badges/coverage-rust.json (root of the
badges branch), but coverage.yml wrote the JSON into a badges/ subdirectory, so the
published path was .../badges/badges/coverage-rust.json and the badges 404'd
('resource not found'). Write coverage-rust.json / coverage-python.json at the
branch root instead.

Co-authored-by: Isaac <no-reply@databricks.com>
@HyukjinKwon HyukjinKwon changed the title [SPARK-58987][INFRA][FOLLOWUP] Publish coverage badges at the badges-branch root [SPARK-59033][INFRA] Publish coverage badges at the badges-branch root Aug 26, 2026
The udfs docs page mangled type names (Vec<T>, Option<T>, Vec<Option<String>>,
udf::<name>): two inline code spans wrapped across a line, so with md_in_html the
bare <...> after the unclosed span were parsed as HTML tags and dropped. Collapse
those spans onto one line. Also drop the obsolete
'export SPARK_CONNECT_WASM_PACKER_PATH=...' line from the run example — the packer
is now embedded in the crate, so no path is needed.

Co-authored-by: Isaac <no-reply@databricks.com>
@HyukjinKwon HyukjinKwon changed the title [SPARK-59033][INFRA] Publish coverage badges at the badges-branch root [SPARK-59033][INFRA][DOCS] Coverage badges at branch root + fix udfs page rendering Aug 26, 2026
HyukjinKwon and others added 3 commits August 27, 2026 08:14
The four ```rust,ignore fences on the UDFs page never rendered as code:
pymdownx.superfences rejects a comma in the fence info string, so the
fence isn't recognized at all - the backticks show up literally and the
`#[spark_wasm_udf]` / `#[cfg(...)]` lines inside get parsed as H1
headings (see the reported screenshot). `rust,ignore` is rustdoc/mdBook
doctest syntax, not mkdocs; the site just wants a language, so use
```rust.

Verified by rendering the whole page through the site's exact extension
set: 7 code blocks, no stray backticks, no bogus headings.

Co-authored-by: Isaac <no-reply@databricks.com>
The README's UDF section led with the low-level factory (read a prebuilt
`.wasm`, spell out AbiTypes by hand), which isn't how UDFs are written in
other languages. Lead instead with the self-contained macro flow: define
plain Rust functions with `#[spark_wasm_udf]` and call them directly
(`udf::add_one(col("id"))`) or register by name for SQL
(`spark.udf().register("shout", &udf::shout_udf())`), all in one file --
matching the `examples/wasm-udf-inline/` example. The lower-level factory
is now a pointer into the guide.

Verified against the crate: range(5)? -> Result, select -> DataFrame,
Column::alias consumes self, SparkSession::udf()/register take
&UserDefinedFunction, and the macro emits udf::<name>_udf() ->
UserDefinedFunction.

Co-authored-by: Isaac <no-reply@databricks.com>
…ction)

Drop the standalone "API Parity & Drop-in Replacement" section and fold
its claim into a single clause in the intro. Shorten the UDF section to a
minimal define-and-call example and defer the full setup / SQL
registration / supported types to the WASM UDF guide.

Co-authored-by: Isaac <no-reply@databricks.com>
…e check

My previous fix flipped the UDFs page from ```rust,ignore to ```rust so
superfences would render it. That also opted those blocks INTO
check_doc_snippets.py (which compiles every plain ```rust block), and
they can't compile in that harness -- they use the `wasm-udf`
`#[spark_wasm_udf]` macro, a build.rs embedding step, and the generated
`udf::*` module -- so the Docs job's snippet-compile step failed.

Use the ```{.rust .no-run} brace fence instead: superfences still renders
it as a Rust code block (verified through the site's exact extension
set), but the checker's `^```rust$` regex doesn't match it, so it's
skipped -- the renderable equivalent of rustdoc's `ignore`. Document the
convention in check_doc_snippets.py so `rust,ignore` (which breaks
rendering) isn't reintroduced.

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants