Skip to content

Commit

Permalink
fix: use upload v2 for slack (#28783)
Browse files Browse the repository at this point in the history
(cherry picked from commit a608bdb)
  • Loading branch information
eschutho authored and sadpandajoe committed May 30, 2024
1 parent 64db275 commit 5072c79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion superset/reports/notifications/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def send(self) -> None:
# files_upload returns SlackResponse as we run it in sync mode.
if files:
for file in files:
client.files_upload(
client.files_upload_v2(
channels=channel,
file=file,
initial_comment=body,
Expand Down
6 changes: 3 additions & 3 deletions tests/integration_tests/reports/commands_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ def test_email_dashboard_report_schedule_force_screenshot(
@pytest.mark.usefixtures(
"load_birth_names_dashboard_with_slices", "create_report_slack_chart"
)
@patch("superset.reports.notifications.slack.WebClient.files_upload")
@patch("superset.utils.slack.WebClient.files_upload_v2")
@patch("superset.utils.screenshots.ChartScreenshot.get_screenshot")
def test_slack_chart_report_schedule(
screenshot_mock,
Expand Down Expand Up @@ -1211,7 +1211,7 @@ def test_slack_chart_report_schedule_with_errors(
@pytest.mark.usefixtures(
"load_birth_names_dashboard_with_slices", "create_report_slack_chart_with_csv"
)
@patch("superset.reports.notifications.slack.WebClient.files_upload")
@patch("superset.utils.slack.WebClient.files_upload_v2")
@patch("superset.utils.csv.urllib.request.urlopen")
@patch("superset.utils.csv.urllib.request.OpenerDirector.open")
@patch("superset.utils.csv.get_chart_csv_data")
Expand Down Expand Up @@ -1378,7 +1378,7 @@ def test_report_schedule_success_grace(create_alert_slack_chart_success):


@pytest.mark.usefixtures("create_alert_slack_chart_grace")
@patch("superset.reports.notifications.slack.WebClient.files_upload")
@patch("superset.utils.slack.WebClient.files_upload_v2")
@patch("superset.utils.screenshots.ChartScreenshot.get_screenshot")
def test_report_schedule_success_grace_end(
screenshot_mock, file_upload_mock, create_alert_slack_chart_grace
Expand Down

0 comments on commit 5072c79

Please sign in to comment.