Skip to content

feat(models): allow raw_number cells in TableBlock rows - #1964

Open
zimeg wants to merge 3 commits into
mainfrom
table-raw-number-cell
Open

feat(models): allow raw_number cells in TableBlock rows#1964
zimeg wants to merge 3 commits into
mainfrom
table-raw-number-cell

Conversation

@zimeg

@zimeg zimeg commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

This pull request fixes the TableBlock model in slack_sdk.models.blocks to allow raw_number cells, which the table-block reference documents but the model omitted.

  • The docs state table cells "can have a type of rich_text, raw_text, or raw_number", but TableBlock.rows accepted only RawTextObject | RichTextBlock (no raw_number) and its docstring said only "raw_text or rich_text".
  • Adds the RawNumberObject composition object (type: 'raw_number', value, text) — the same definition introduced by the data_table PR feat(models): add data_table Block Kit block #1900, so the two share one cell object and whichever lands second drops the duplicate in a trivial merge.
  • Adds RawNumberObject to TableBlock.rows, exports it from the blocks package, and corrects the TableBlock docstring to match the docs.
  • Adds RawNumberObject unit coverage and raw_number table-cell tests (including a column_settings + raw_number combination).

Depends on #1900 (which introduces RawNumberObject for the net-new data_table block); expected to rebase cleanly and drop the duplicate once #1900 lands. Mirrors the node-slack-sdk change in slackapi/node-slack-sdk#2737.

Category (place an x in each of the [ ])

  • slack_sdk.models (UI component builders)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/run_validation.sh after making the changes.

zimeg and others added 2 commits September 9, 2026 16:06
The table-block reference documents table cells as `rich_text`, `raw_text`,
or `raw_number`, but `TableBlock.rows` accepted only `RawTextObject` and
`RichTextBlock`, and its docstring said only "raw_text or rich_text".

- Add the `RawNumberObject` composition object (`type: raw_number`, `value`,
  `text`) — the same definition introduced by the data_table PR #1900, so the
  two share one cell object and whichever lands second drops the duplicate.
- Add `RawNumberObject` to `TableBlock.rows` and export it from the package.
- Correct the `TableBlock.rows` docstring to match the docs.
- Add `RawNumberObject` unit coverage and `raw_number` table-cell tests.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Place RawNumberObjectTests before RawTextObjectTests so the two adjacent
Raw* test classes follow the same order as basic_components.py, where
RawNumberObject is defined ahead of RawTextObject.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.15%. Comparing base (0824928) to head (aadf493).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1964      +/-   ##
==========================================
+ Coverage   84.13%   84.15%   +0.01%     
==========================================
  Files         118      118              
  Lines       13556    13566      +10     
==========================================
+ Hits        11406    11416      +10     
  Misses       2150     2150              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🗣️ A similar comment as adjacent implementation of similar table details for #1900

return len(self.text) >= 1


class RawTextObject(TextObject):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🎲 note: This and the RawNumberObject above might later be moved to tests for composition objects perhaps?

@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor models labels Sep 10, 2026
@zimeg zimeg self-assigned this Sep 10, 2026
@zimeg zimeg added this to the 3.next milestone Sep 10, 2026
@zimeg
zimeg marked this pull request as ready for review September 10, 2026 01:00
@zimeg
zimeg requested a review from a team as a code owner September 10, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality models semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant