Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pin slack client, breaking change #10345

Merged
merged 1 commit into from Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -86,7 +86,7 @@ retry==0.9.2 # via apache-superset (setup.py)
selenium==3.141.0 # via apache-superset (setup.py)
simplejson==3.17.0 # via apache-superset (setup.py)
six==1.14.0 # via bleach, cryptography, flask-jwt-extended, flask-talisman, isodate, jsonschema, packaging, pathlib2, polyline, prison, pyrsistent, python-dateutil, sqlalchemy-utils, wtforms-json
slackclient==2.6.2 # via apache-superset (setup.py)
slackclient==2.5.0 # via apache-superset (setup.py)
sqlalchemy-utils==0.36.6 # via apache-superset (setup.py), flask-appbuilder
sqlalchemy==1.3.16 # via alembic, apache-superset (setup.py), flask-sqlalchemy, marshmallow-sqlalchemy, sqlalchemy-utils
sqlparse==0.3.0 # via apache-superset (setup.py)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -102,7 +102,7 @@ def get_git_sha():
"retry>=0.9.2",
"selenium>=3.141.0",
"simplejson>=3.15.0",
"slackclient>=2.6.2",
"slackclient==2.5.0", # PINNED! slack changes file upload api in the future versions
"sqlalchemy>=1.3.16, <2.0",
"sqlalchemy-utils>=0.36.6,<0.37",
"sqlparse==0.3.0", # PINNED! see https://github.com/andialbrecht/sqlparse/issues/562
Expand Down
10 changes: 10 additions & 0 deletions tests/schedules_test.py
Expand Up @@ -19,7 +19,9 @@
from unittest.mock import Mock, patch, PropertyMock

from flask_babel import gettext as __
import pytest
from selenium.common.exceptions import WebDriverException
from slack import errors, WebClient

from tests.test_app import app
from superset import db
Expand Down Expand Up @@ -530,3 +532,11 @@ def test_deliver_slice_csv_inline(
"title": "[Report] Participants",
},
)


def test_slack_client_compatibility():
c2 = WebClient()
# slackclient >2.5.0 raises TypeError: a bytes-like object is required, not 'str
# and requires to path a filepath instead of the bytes directly
with pytest.raises(errors.SlackApiError):
c2.files_upload(channels="#bogdan-test2", file=b"blabla", title="Test upload")