Skip to content

docs: Fix formatting of code blocks in develop/table-functions.rst#27502

Open
steveburnett wants to merge 1 commit intoprestodb:masterfrom
steveburnett:steveburnett-table-functions-formatting
Open

docs: Fix formatting of code blocks in develop/table-functions.rst#27502
steveburnett wants to merge 1 commit intoprestodb:masterfrom
steveburnett:steveburnett-table-functions-formatting

Conversation

@steveburnett
Copy link
Copy Markdown
Contributor

@steveburnett steveburnett commented Apr 3, 2026

Description

Edited the formatting of code blocks in develop/table-functions.rst to fix warnings during doc builds.

Motivation and Context

Reducing the warnings displayed in a doc build allows doc builds to run faster, and simplifies the work to debug future problems.

Impact

Doc builds.

Test Plan

Local doc builds.

Before:
The following displayed in the output of a local doc build:

[...]

/Users/steveburnett/Documents/GitHub/presto/presto-docs/src/main/sphinx/develop/table-functions.rst:25: WARNING: Lexing literal_block 'public class MyFunction\n        extends AbstractConnectorTableFunction\n{\n    public MyFunction()\n    {\n        super(\n                "system",\n                "my_function",\n                List.of(\n                        ScalarArgumentSpecification.builder()\n                                .name("COLUMN_COUNT")\n                                .type(INTEGER)\n                                .defaultValue(2)\n                                .build(),\n                        ScalarArgumentSpecification.builder()\n                                .name("ROW_COUNT")\n                                .type(INTEGER)\n                                .build()),\n                  GENERIC_TABLE);\n    }\n}' as "sql" resulted in an error at token: '{'. Retrying in relaxed mode. [misc.highlighting_failure]
/Users/steveburnett/Documents/GitHub/presto/presto-docs/src/main/sphinx/develop/table-functions.rst:200: WARNING: Lexing literal_block '@Override\npublic TableFunctionAnalysis analyze(ConnectorSession session, ConnectorTransactionHandle transaction, Map<String, Argument> arguments)\n{\n    long columnCount = (long) ((ScalarArgument) arguments.get("COLUMN_COUNT")).getValue();\n    long rowCount = (long) ((ScalarArgument) arguments.get("ROW_COUNT")).getValue();\n\n    // custom validation of arguments\n    if (columnCount < 1 || columnCount > 3) {\n        throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "column_count must be in range [1, 3]");\n    }\n\n    if (rowCount < 1) {\n        throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "row_count must be positive");\n    }\n\n    // determine the returned row type\n    List<Descriptor.Field> fields = List.of("col_a", "col_b", "col_c").subList(0, (int) columnCount).stream()\n            .map(name -> new Descriptor.Field(name, Optional.of(BIGINT)))\n            .collect(toList());\n\n    Descriptor returnedType = new Descriptor(fields);\n\n    return TableFunctionAnalysis.builder()\n            .returnedType(returnedType)\n            .handle(new MyHandle(columnCount, rowCount))\n            .build();\n}' as "sql" resulted in an error at token: '{'. Retrying in relaxed mode. [misc.highlighting_failure]


build succeeded, 55 warnings.

After:

(the two warnings shown here are not displayed)

build succeeded, 53 warnings.

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

== NO RELEASE NOTE ==

Summary by Sourcery

Documentation:

  • Adjust code block language markers in develop/table-functions.rst so Java examples are highlighted correctly and no longer trigger doc build warnings.

@steveburnett steveburnett self-assigned this Apr 3, 2026
@steveburnett steveburnett requested review from a team and elharo as code owners April 3, 2026 18:28
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Apr 3, 2026
@github-project-automation github-project-automation bot moved this to 🆕 Unprioritized in Presto Documentation Apr 3, 2026
@prestodb-ci prestodb-ci requested a review from a team April 3, 2026 18:29
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 3, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts Sphinx code-block language directives in develop/table-functions.rst so Java examples are highlighted correctly and no longer trigger lexing warnings in doc builds.

File-Level Changes

Change Details Files
Correct code block language annotations for Java examples so Sphinx no longer tries to lex them as SQL.
  • Update language specifiers on Java code examples from SQL (or incorrect types) to Java-appropriate code-block directives
  • Ensure multi-line Java snippets (class definition and analyze method) are within properly indented literal blocks for Sphinx
  • Align surrounding RST formatting so doc builds run without the previous highlighting_failure warnings
presto-docs/src/main/sphinx/develop/table-functions.rst

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@prestodb-ci prestodb-ci requested review from infvg and libianoss and removed request for a team April 3, 2026 18:29
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@steveburnett steveburnett moved this from 🆕 Unprioritized to 👀 Review in Presto Documentation Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs from:IBM PR from IBM

Projects

Status: 👀 Review

Development

Successfully merging this pull request may close these issues.

2 participants