feat(models): add data_visualization Block Kit block#1899
Draft
zimeg wants to merge 1 commit into
Draft
Conversation
Add DataVisualizationBlock supporting pie, bar, area, and line charts, including title length and chart type validation, parse() registration, package exports, and tests mirroring existing block coverage. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1899 +/- ##
==========================================
+ Coverage 84.14% 84.17% +0.02%
==========================================
Files 117 117
Lines 13356 13412 +56
==========================================
+ Hits 11238 11289 +51
- Misses 2118 2123 +5 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the net-new
data_visualizationBlock Kit block to the SDK's block models. The block renders data as apie,bar,area, orlinechart.DataVisualizationBlock(type: "data_visualization") inslack_sdk/models/blocks/blocks.pywithtitle(required, max 50 chars),chart(required), and optionalblock_id.chartobject is accepted as a dict (consistent with howTableBlock/DataTableBlockmodel their nested structures): apiechart carriessegments;bar/area/linecarryseriesplusaxis_config.titlepresence + length (<=50),chartpresence, andchart.typemembership in{pie, bar, area, line}.Block.parse()and exported fromslack_sdk/models/blocks/__init__.py(DataVisualizationBlockin both the import and__all__).tests/slack_sdk/models/test_blocks.pymirroring the existingDataTableBlockcoverage (doc example, bar chart with block_id, line chart with negatives, required-arg and validation cases).Docs
https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block
Validation steps run
black --line-length 125on the touched files: no changes (already compliant).pytest tests/slack_sdk/models/test_blocks.py: 97 passed (7 newDataVisualizationBlockcases included).mypy slack_sdk/models/blocks/blocks.py: success, no issues.to_dict()round-trip andBlock.parse()resolve toDataVisualizationBlock.No changeset added: this repo does not use
.changeset/(version is managed viaslack_sdk/version.py).Co-Authored-By: Claude svc-devxp-claude@slack-corp.com