You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2023/08/22 20:11:17 UTC

[GitHub] [superset] michael-s-molina opened a new pull request, #25057: fix: Error when using the legacy dataset editor

michael-s-molina opened a new pull request, #25057:
URL: https://github.com/apache/superset/pull/25057

   ### SUMMARY
   This PR fixes an error that was happening when using the legacy dataset editor:
   
   ```
   File "python3.9/site-packages/flask_appbuilder/fields.py", line 128, in <genexpr>
       self._object_list = list((str(self.get_pk_func(obj)), obj) for obj in objs)
   ```
   
   Using [git bisect](https://git-scm.com/docs/git-bisect), I was able to pinpoint https://github.com/apache/superset/pull/23680 as the root cause for the error.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before: An error was thrown when accessing the legacy editor
   
   <img width="1711" alt="Screenshot 2023-08-22 at 17 02 06" src="https://github.com/apache/superset/assets/70410625/0a755d7b-e841-4405-b324-3fd155c1efe5">
   
   After: The editor rendered correctly
   
   <img width="1509" alt="Screenshot 2023-08-22 at 17 01 35" src="https://github.com/apache/superset/assets/70410625/74327d63-19fd-4c2f-bb74-e4bd508fe9f7">
   
   ### TESTING INSTRUCTIONS
   1 - Set `DISABLE_LEGACY_DATASOURCE_EDITOR` to `False`
   2 - Edit a dataset using the legacy dataset editor
   3 - It should render the legacy dataset editor
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] john-bodley commented on a diff in pull request #25057: fix: Error when using the legacy dataset editor

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #25057:
URL: https://github.com/apache/superset/pull/25057#discussion_r1302155375


##########
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 a: a.id,

Review Comment:
   I think `item`—which is used elsewhere (including the DAOs)—is likely clearer that `a`.



##########
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 a: a.id,

Review Comment:
   I think `item`—which is used elsewhere (including the DAOs)—is likely clearer that `a`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina merged pull request #25057: fix: Error when using the legacy dataset editor

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #25057:
URL: https://github.com/apache/superset/pull/25057


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] john-bodley commented on a diff in pull request #25057: fix: Error when using the legacy dataset editor

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #25057:
URL: https://github.com/apache/superset/pull/25057#discussion_r1302154492


##########
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 a: a.id,

Review Comment:
   ```suggestion
               get_pk_func=lambda item: item.id,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org