You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/08/23 12:58:49 UTC
[superset] 05/06: fix: Error when using the legacy dataset editor (#25057)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit b5f7f54c7fc42090b00ff04a1a2988e999aa57ef
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Wed Aug 23 09:10:17 2023 -0300
fix: Error when using the legacy dataset editor (#25057)
Co-authored-by: John Bodley <45...@users.noreply.github.com>
(cherry picked from commit c92a975e4b72962baf34d1fcbf2ee38011199377)
---
.pre-commit-config.yaml | 7 ++++---
superset/connectors/sqla/views.py | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 07544d66d2..9e0318456d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -42,12 +42,13 @@ repos:
hooks:
- id: mypy
args: [--check-untyped-defs]
- additional_dependencies:
- [
+ additional_dependencies: [
types-simplejson,
types-python-dateutil,
types-requests,
- types-redis,
+ # types-redis 4.6.0.5 is failing mypy
+ # because of https://github.com/python/typeshed/pull/10531
+ types-redis==4.6.0.4,
types-pytz,
types-croniter,
types-PyYAML,
diff --git a/superset/connectors/sqla/views.py b/superset/connectors/sqla/views.py
index f72261eff8..4f32be1ad8 100644
--- a/superset/connectors/sqla/views.py
+++ b/superset/connectors/sqla/views.py
@@ -411,6 +411,7 @@ class TableModelView( # pylint: disable=too-many-ancestors
"database": QuerySelectField(
"Database",
query_func=lambda: db.session.query(models.Database),
+ get_pk_func=lambda item: item.id,
widget=Select2Widget(extra_classes="readonly"),
)
}