diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index afb1cc0..677f469 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -23,7 +23,7 @@ jobs: pip install -U pip pip install -e ".[testing]" # We manually upgrade it to make the builds stable - pip install "flake8==4.0.1" + pip install "flake8==6.1.0" - name: Run flake8 run: | flake8 slack_discovery_sdk/ diff --git a/.github/workflows/pytype.yml b/.github/workflows/pytype.yml index 8720783..da7f039 100644 --- a/.github/workflows/pytype.yml +++ b/.github/workflows/pytype.yml @@ -23,7 +23,7 @@ jobs: pip install -U pip pip install -e ".[testing]" # As pytype can change its behavior in newer versions, we manually upgrade it - pip install "pytype==2023.05.24" + pip install "pytype==2023.9.27" - name: Run pytype run: | pytype slack_discovery_sdk/ diff --git a/slack_discovery_sdk/examples/DLP_call_pattern.py b/slack_discovery_sdk/examples/DLP_call_pattern.py index d478550..8bcbdf9 100644 --- a/slack_discovery_sdk/examples/DLP_call_pattern.py +++ b/slack_discovery_sdk/examples/DLP_call_pattern.py @@ -39,7 +39,6 @@ ) for message in channel_conversation["messages"]: - # Step 3 - check each message and see if it contains a credit card number. If it does, tombstone the message. # A valid credit card for our logic is something like the following: '5122-2368-7954-3214' # Please note this is just example logic, to help you understand how to use the Discovery APIs. diff --git a/slack_discovery_sdk/examples/user_based_eDiscovery_pattern.py b/slack_discovery_sdk/examples/user_based_eDiscovery_pattern.py index 261bab5..083c96b 100644 --- a/slack_discovery_sdk/examples/user_based_eDiscovery_pattern.py +++ b/slack_discovery_sdk/examples/user_based_eDiscovery_pattern.py @@ -32,7 +32,6 @@ list_of_conversations = client.discovery_user_conversations(user=user_id, limit=500) for conversation in list_of_conversations["channels"]: - channel_id = conversation["id"] team_id = conversation["team_id"] diff --git a/slack_discovery_sdk/examples/user_based_eDiscovery_with_edits.py b/slack_discovery_sdk/examples/user_based_eDiscovery_with_edits.py index ffa311b..3cd646c 100644 --- a/slack_discovery_sdk/examples/user_based_eDiscovery_with_edits.py +++ b/slack_discovery_sdk/examples/user_based_eDiscovery_with_edits.py @@ -32,7 +32,6 @@ list_of_conversations = client.discovery_user_conversations(user=user_id, limit=500) for conversation in list_of_conversations["channels"]: - channel_id = conversation["id"] team_id = conversation["team_id"] diff --git a/slack_discovery_sdk/response.py b/slack_discovery_sdk/response.py index c05ce05..6fb84d7 100644 --- a/slack_discovery_sdk/response.py +++ b/slack_discovery_sdk/response.py @@ -10,11 +10,11 @@ _LATEST_OFFSET_APIS = [ - 'discovery.conversations.history', - 'discovery.conversations.edits', - 'discovery.conversations.renames', - 'discovery.conversations.reactions', - 'discovery.conversations.recent', + "discovery.conversations.history", + "discovery.conversations.edits", + "discovery.conversations.renames", + "discovery.conversations.reactions", + "discovery.conversations.recent", ] @@ -129,7 +129,12 @@ def __next__(self): # offset for https://api.slack.com/enterprise/discovery/methods#users_list etc. params.update({"offset": self.body.get("offset")}) - if any([latest_offset_api in self.api_url for latest_offset_api in _LATEST_OFFSET_APIS]): + if any( + [ + latest_offset_api in self.api_url + for latest_offset_api in _LATEST_OFFSET_APIS + ] + ): params.update({"latest": self.body.get("offset")}) response = self._client.fetch_next_page( # skipcq: PYL-W0212 diff --git a/tests/test_conversations.py b/tests/test_conversations.py index c7697d8..4eb0a05 100644 --- a/tests/test_conversations.py +++ b/tests/test_conversations.py @@ -95,8 +95,10 @@ def test_conversations_history_pagination(self): conversations = [] limit_size = 1 page_num = 0 - for page in self.client.discovery_conversations_history(channel=self.channel, team=self.team, limit=limit_size): - for message in page['messages']: + for page in self.client.discovery_conversations_history( + channel=self.channel, team=self.team, limit=limit_size + ): + for message in page["messages"]: conversations.append(json.dumps(message)) page_num += 1 if page_num > 5: