From 1d0fda638642b07b03d7ed85aa6de1b8c768d355 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Wed, 30 Oct 2024 10:36:07 +0900 Subject: [PATCH] version 3.33.3 --- .../slack_sdk/models/basic_objects.html | 33 +++++++++++++++++++ .../api-docs/slack_sdk/models/index.html | 16 +++++++++ docs/static/api-docs/slack_sdk/version.html | 2 +- slack_sdk/version.py | 2 +- 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/docs/static/api-docs/slack_sdk/models/basic_objects.html b/docs/static/api-docs/slack_sdk/models/basic_objects.html index 7bc4a65e..0a5172a6 100644 --- a/docs/static/api-docs/slack_sdk/models/basic_objects.html +++ b/docs/static/api-docs/slack_sdk/models/basic_objects.html @@ -40,6 +40,15 @@

Module slack_sdk.models.basic_objects

return f"<slack_sdk.{self.__class__.__name__}>" +# Usually, Block Kit components do not allow an empty array for a property value, but there are some exceptions. +EMPTY_ALLOWED_TYPE_AND_PROPERTY_LIST = [ + {"type": "rich_text_section", "property": "elements"}, + {"type": "rich_text_list", "property": "elements"}, + {"type": "rich_text_preformatted", "property": "elements"}, + {"type": "rich_text_quote", "property": "elements"}, +] + + class JsonObject(BaseObject, metaclass=ABCMeta): """The base class for JSON serializable class objects""" @@ -79,6 +88,14 @@

Module slack_sdk.models.basic_objects

value = getattr(self, key, None) if value is None: return False + + # Usually, Block Kit components do not allow an empty array for a property value, but there are some exceptions. + # The following code deals with these exceptions: + type_value = getattr(self, "type", None) + for empty_allowed in EMPTY_ALLOWED_TYPE_AND_PROPERTY_LIST: + if type_value == empty_allowed["type"] and key == empty_allowed["property"]: + return True + has_len = getattr(value, "__len__", None) is not None if has_len: # skipcq: PYL-R1705 return len(value) > 0 @@ -244,6 +261,14 @@

Ancestors

value = getattr(self, key, None) if value is None: return False + + # Usually, Block Kit components do not allow an empty array for a property value, but there are some exceptions. + # The following code deals with these exceptions: + type_value = getattr(self, "type", None) + for empty_allowed in EMPTY_ALLOWED_TYPE_AND_PROPERTY_LIST: + if type_value == empty_allowed["type"] and key == empty_allowed["property"]: + return True + has_len = getattr(value, "__len__", None) is not None if has_len: # skipcq: PYL-R1705 return len(value) > 0 @@ -357,6 +382,14 @@

Methods

value = getattr(self, key, None) if value is None: return False + + # Usually, Block Kit components do not allow an empty array for a property value, but there are some exceptions. + # The following code deals with these exceptions: + type_value = getattr(self, "type", None) + for empty_allowed in EMPTY_ALLOWED_TYPE_AND_PROPERTY_LIST: + if type_value == empty_allowed["type"] and key == empty_allowed["property"]: + return True + has_len = getattr(value, "__len__", None) is not None if has_len: # skipcq: PYL-R1705 return len(value) > 0 diff --git a/docs/static/api-docs/slack_sdk/models/index.html b/docs/static/api-docs/slack_sdk/models/index.html index 04c55c86..39b44a7d 100644 --- a/docs/static/api-docs/slack_sdk/models/index.html +++ b/docs/static/api-docs/slack_sdk/models/index.html @@ -294,6 +294,14 @@

Ancestors

value = getattr(self, key, None) if value is None: return False + + # Usually, Block Kit components do not allow an empty array for a property value, but there are some exceptions. + # The following code deals with these exceptions: + type_value = getattr(self, "type", None) + for empty_allowed in EMPTY_ALLOWED_TYPE_AND_PROPERTY_LIST: + if type_value == empty_allowed["type"] and key == empty_allowed["property"]: + return True + has_len = getattr(value, "__len__", None) is not None if has_len: # skipcq: PYL-R1705 return len(value) > 0 @@ -407,6 +415,14 @@

Methods

value = getattr(self, key, None) if value is None: return False + + # Usually, Block Kit components do not allow an empty array for a property value, but there are some exceptions. + # The following code deals with these exceptions: + type_value = getattr(self, "type", None) + for empty_allowed in EMPTY_ALLOWED_TYPE_AND_PROPERTY_LIST: + if type_value == empty_allowed["type"] and key == empty_allowed["property"]: + return True + has_len = getattr(value, "__len__", None) is not None if has_len: # skipcq: PYL-R1705 return len(value) > 0 diff --git a/docs/static/api-docs/slack_sdk/version.html b/docs/static/api-docs/slack_sdk/version.html index bc700c80..6679b631 100644 --- a/docs/static/api-docs/slack_sdk/version.html +++ b/docs/static/api-docs/slack_sdk/version.html @@ -28,7 +28,7 @@

Module slack_sdk.version

Expand source code
"""Check the latest version at https://pypi.org/project/slack-sdk/"""
-__version__ = "3.33.2"
+__version__ = "3.33.3"
diff --git a/slack_sdk/version.py b/slack_sdk/version.py index 3394505a..dc23c869 100644 --- a/slack_sdk/version.py +++ b/slack_sdk/version.py @@ -1,2 +1,2 @@ """Check the latest version at https://pypi.org/project/slack-sdk/""" -__version__ = "3.33.2" +__version__ = "3.33.3"