| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Mirrors the official Block Kit data_table docs example in the bolt-python-examples block-kit project: a captioned table with a header row and rich-text badge cells. The data_table block is net-new and not yet in a published slack_sdk release, so the example defines a DataTableBlock(Block) subclass that mirrors the SDK convention, matching the neighboring data_visualization example. Swap to the slack_sdk type once it ships. Docs: https://docs.slack.dev/reference/block-kit/blocks/data-table-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Replace the hand-rolled DataTableBlock(Block) subclass with an import of DataTableBlock from slack_sdk.models.blocks, and build the row cells with model classes (RawTextObject, RichTextBlock / RichTextSectionElement / RichTextElementParts) instead of raw dicts. slack_sdk does not yet export DataTableBlock, so both mypy and pytest (collection) fail by design — the example genuinely cannot run until the SDK ships the class, rather than a local subclass masking the gap. Ruff and formatting pass; the serialized shape is unchanged, so the existing to_dict() assertion stays valid once the class ships. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…o helper Replace the hand-rolled DataTableBlock(Block) subclass with an import of DataTableBlock from slack_sdk.models.blocks. Keep the row cells as plain dicts (matching the sibling table example, whose TableBlock.rows is typed as Sequence[Sequence[Dict[str, Any]]]) and drop the local helper — the example stays flat and copy-pasteable. slack_sdk does not yet export DataTableBlock, so mypy and pytest fail by design on the missing import (not on cell shapes) — the honest signal that the block is not yet available, unblocking when the SDK ships it. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
| Back | FazBrowse Home | New Git URL |
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.
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):
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