Skip to content

feat(block-kit): add data table block example#98

Draft
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-data-table-example
Draft

feat(block-kit): add data table block example#98
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-data-table-example

Conversation

@zimeg

@zimeg zimeg commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds a data_table Block Kit example to the block-kit showcase, mirroring the official docs example.

The data_table block is net-new and is not yet in slack_sdk (confirmed absent in the pinned slack_sdk==3.42.0). This example defines a small, typed DataTableBlock that subclasses the SDK's slack_sdk.models.blocks.Block base class, following the same implementation pattern the SDK uses for TableBlock (validators for the required rows and caption fields, attributes covering rows, caption, page_size, row_header_column_index, block_id). When the SDK ships a native DataTableBlock, this example can be swapped to import it directly.

  • block-kit/src/blocks/data_table.pyexample01() returning a DataTableBlock (raw text header + raw text / rich text cells, with a caption), mirroring the docs example JSON.
  • block-kit/tests/blocks/test_data_table.py — asserts the produced block deep-equals the expected literal (same style as test_table.py / test_task_card.py).
  • block-kit/README.md — alphabetical "Data table" entry with docs + implementation links.

Docs

https://docs.slack.dev/reference/block-kit/blocks/data-table-block

Validation

Run in block-kit/ against the pinned requirements.txt (slack_sdk==3.42.0):

  • ruff check — passed
  • ruff format --diff --check — passed (new files already formatted)
  • mypy src/blocks/data_table.py tests/blocks/test_data_table.py — passed (no issues)
  • pytest tests/blocks/test_data_table.py -v — passed (1 passed)
  • Full pytest -v — all data table tests pass

Note: a repo-wide mypy ./**/*.py currently reports pre-existing errors in src/blocks/carousel.py (unrelated work not part of this PR); the files added here are mypy-clean.

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

Add a data_table Block Kit example mirroring the official docs example,
including a typed DataTableBlock (net-new; not yet in slack_sdk), a unit
test asserting the produced block, and a README entry.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.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.

1 participant