You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/29 00:25:42 UTC

[GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #9637: [WIP][explore view] add partition as adhoc filter option

graceguo-supercat commented on a change in pull request #9637:
URL: https://github.com/apache/incubator-superset/pull/9637#discussion_r417002982



##########
File path: superset-frontend/src/explore/components/controls/AdhocFilterControl.jsx
##########
@@ -90,6 +92,46 @@ export default class AdhocFilterControl extends React.Component {
     };
   }
 
+  componentDidMount() {
+    const { datasource } = this.props;
+    if (datasource && datasource.type === 'table') {
+      const dbId = datasource.database ? datasource.database.id : null;
+      const datasourceName = datasource.datasource_name;
+      const datasourceSchema = datasource.schema;
+
+      if (dbId && datasourceName && datasourceSchema) {
+        SupersetClient.get({
+          endpoint: `/superset/extra_table_metadata/${dbId}/${datasourceName}/${datasourceSchema}/`,
+        }).then(
+          ({ json }) => {
+            if (json && json.partitions) {

Review comment:
       for virtual table, it doesn't have schema, so won't make the API call to get `extra_table_metadata `




----------------------------------------------------------------
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.

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