-
Notifications
You must be signed in to change notification settings - Fork 14k
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
chore: bump black to 19.10b0 and mypy to 0.770 #9378
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,7 +188,10 @@ def check_datasource_perms( | |
except SupersetException as e: | ||
raise SupersetSecurityException(str(e)) | ||
|
||
viz_obj = get_viz( # type: ignore | ||
if datasource_type is None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dislike the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it doesn't hurt to give a more user-friendly error message, would it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
raise SupersetSecurityException("Could not determine datasource type") | ||
|
||
viz_obj = get_viz( | ||
datasource_type=datasource_type, | ||
datasource_id=datasource_id, | ||
form_data=form_data, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,10 @@ | |
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason for this change? It makes typing less strict. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm getting tons of errors about variables from import * being overridden. Didn't find a way to bypass it and thought it wouldn't make much sense to |
||
from copy import copy | ||
|
||
from superset.config import * # type: ignore | ||
from superset.config import * | ||
|
||
AUTH_USER_REGISTRATION_ROLE = "alpha" | ||
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "unittests.db") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,11 @@ | |
# specific language governing permissions and limitations | ||
# under the License. | ||
# flake8: noqa | ||
# type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See ^^. |
||
import os | ||
from copy import copy | ||
|
||
from superset.config import * # type: ignore | ||
from superset.config import * | ||
|
||
AUTH_USER_REGISTRATION_ROLE = "alpha" | ||
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "unittests.db") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this was necessary as it seems
is_adhoc_metric(metric)
can handle both adict
andstr
. I wonder in adding typing there, i.e.,would remove the need for
isinstance(metric, dict)
which is unnecessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and L946 are for function calls later in the current context.
Union[Dict, str]
was passed on toadhoc_agg_configs
,saved_agg_names
andsaved_agg_names
, but could not be accepted byget_aggregations()
andresolve_postagg()
, which only accept either justdict
or juststr
.Apparently
mypy
was not smart enough to figure outmetric
type just by the outcome ofis_adhoc_metric()
.