Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions slack_sdk/models/blocks/block_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,6 @@ def attributes(self) -> Set[str]: # type: ignore[override]
{
"url",
"text",
"icon_url",
}
)

Expand All @@ -1677,7 +1676,6 @@ def __init__(
*,
url: str,
text: str,
icon_url: Optional[str] = None,
**others: Dict,
):
"""
Expand All @@ -1687,13 +1685,11 @@ def __init__(
Args:
url (required): The URL type source.
text (required): Display text for the URL.
icon_url: Optional icon URL to display with the source.
"""
super().__init__(type=self.type)
show_unknown_key_warning(self, others)
self.url = url
self.text = text
self.icon_url = icon_url


# -------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions slack_sdk/web/chat_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ def stop(

def _flush_buffer(self, chunks: Optional[Sequence[Union[Dict, Chunk]]] = None, **kwargs) -> SlackResponse:
"""Flush the internal buffer with chunks by making appropriate API calls."""
flushings: List[Union[Dict, Chunk]] = []
chunks_to_flush: List[Union[Dict, Chunk]] = []
if len(self._buffer) != 0:
flushings.append(MarkdownTextChunk(text=self._buffer))
chunks_to_flush.append(MarkdownTextChunk(text=self._buffer))
if chunks is not None:
flushings.extend(chunks)
chunks_to_flush.extend(chunks)
if not self._stream_ts:
response = self._client.chat_startStream(
**self._stream_args,
token=self._token,
**kwargs,
chunks=flushings,
chunks=chunks_to_flush,
)
self._stream_ts = response.get("ts")
self._state = "in_progress"
Expand All @@ -216,7 +216,7 @@ def _flush_buffer(self, chunks: Optional[Sequence[Union[Dict, Chunk]]] = None, *
channel=self._stream_args["channel"],
ts=self._stream_ts,
**kwargs,
chunks=flushings,
chunks=chunks_to_flush,
)
self._buffer = ""
return response
2 changes: 0 additions & 2 deletions tests/slack_sdk/models/test_chunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def test_json(self):
UrlSourceElement(
text="The Free Encyclopedia",
url="https://wikipedia.org",
icon_url="https://example.com/globe.png",
),
],
).to_dict(),
Expand All @@ -86,7 +85,6 @@ def test_json(self):
"type": "url",
"text": "The Free Encyclopedia",
"url": "https://wikipedia.org",
"icon_url": "https://example.com/globe.png",
},
],
},
Expand Down