-
Notifications
You must be signed in to change notification settings - Fork 16.6k
chore: bump black to 19.10b0 and mypy to 0.770 #9378
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
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: | ||
|
||
| 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 | ||
|
||
| 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 | ||
|
||
| 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 adictandstr. I wonder in adding typing there, i.e.,would remove the need for
isinstance(metric, dict)which is unnecessary.Uh oh!
There was an error while loading. Please reload this page.
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_namesandsaved_agg_names, but could not be accepted byget_aggregations()andresolve_postagg(), which only accept either justdictor juststr.Apparently
mypywas not smart enough to figure outmetrictype just by the outcome ofis_adhoc_metric().