Skip to content

Commit d8a593c

Browse files
committed
Upgrade validation tool versions
1 parent ed5f010 commit d8a593c

File tree

7 files changed

+17
-13
lines changed

7 files changed

+17
-13
lines changed

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
pip install -U pip
2424
pip install -e ".[testing]"
2525
# We manually upgrade it to make the builds stable
26-
pip install "flake8==4.0.1"
26+
pip install "flake8==6.1.0"
2727
- name: Run flake8
2828
run: |
2929
flake8 slack_discovery_sdk/

.github/workflows/pytype.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
pip install -U pip
2424
pip install -e ".[testing]"
2525
# As pytype can change its behavior in newer versions, we manually upgrade it
26-
pip install "pytype==2023.05.24"
26+
pip install "pytype==2023.9.27"
2727
- name: Run pytype
2828
run: |
2929
pytype slack_discovery_sdk/

slack_discovery_sdk/examples/DLP_call_pattern.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
)
4040

4141
for message in channel_conversation["messages"]:
42-
4342
# Step 3 - check each message and see if it contains a credit card number. If it does, tombstone the message.
4443
# A valid credit card for our logic is something like the following: '5122-2368-7954-3214'
4544
# Please note this is just example logic, to help you understand how to use the Discovery APIs.

slack_discovery_sdk/examples/user_based_eDiscovery_pattern.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
list_of_conversations = client.discovery_user_conversations(user=user_id, limit=500)
3333

3434
for conversation in list_of_conversations["channels"]:
35-
3635
channel_id = conversation["id"]
3736
team_id = conversation["team_id"]
3837

slack_discovery_sdk/examples/user_based_eDiscovery_with_edits.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
list_of_conversations = client.discovery_user_conversations(user=user_id, limit=500)
3333

3434
for conversation in list_of_conversations["channels"]:
35-
3635
channel_id = conversation["id"]
3736
team_id = conversation["team_id"]
3837

slack_discovery_sdk/response.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111

1212
_LATEST_OFFSET_APIS = [
13-
'discovery.conversations.history',
14-
'discovery.conversations.edits',
15-
'discovery.conversations.renames',
16-
'discovery.conversations.reactions',
17-
'discovery.conversations.recent',
13+
"discovery.conversations.history",
14+
"discovery.conversations.edits",
15+
"discovery.conversations.renames",
16+
"discovery.conversations.reactions",
17+
"discovery.conversations.recent",
1818
]
1919

2020

@@ -129,7 +129,12 @@ def __next__(self):
129129
# offset for https://api.slack.com/enterprise/discovery/methods#users_list etc.
130130
params.update({"offset": self.body.get("offset")})
131131

132-
if any([latest_offset_api in self.api_url for latest_offset_api in _LATEST_OFFSET_APIS]):
132+
if any(
133+
[
134+
latest_offset_api in self.api_url
135+
for latest_offset_api in _LATEST_OFFSET_APIS
136+
]
137+
):
133138
params.update({"latest": self.body.get("offset")})
134139

135140
response = self._client.fetch_next_page( # skipcq: PYL-W0212

tests/test_conversations.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ def test_conversations_history_pagination(self):
9595
conversations = []
9696
limit_size = 1
9797
page_num = 0
98-
for page in self.client.discovery_conversations_history(channel=self.channel, team=self.team, limit=limit_size):
99-
for message in page['messages']:
98+
for page in self.client.discovery_conversations_history(
99+
channel=self.channel, team=self.team, limit=limit_size
100+
):
101+
for message in page["messages"]:
100102
conversations.append(json.dumps(message))
101103
page_num += 1
102104
if page_num > 5:

0 commit comments

Comments
 (0)