superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grace...@apache.org
Subject [incubator-superset] branch master updated: [SQL Lab] Fix TableSelector perf for large option sets (#7868)
Date Mon, 22 Jul 2019 21:39:23 GMT
This is an automated email from the ASF dual-hosted git repository.

graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a1dcaa  [SQL Lab] Fix TableSelector perf for large option sets (#7868)
7a1dcaa is described below

commit 7a1dcaae8ae0e3f767dbd88bce61c78b9fbd7241
Author: Erik Ritter <erik.ritter@airbnb.com>
AuthorDate: Mon Jul 22 14:39:12 2019 -0700

    [SQL Lab] Fix TableSelector perf for large option sets (#7868)
---
 superset/assets/spec/javascripts/components/TableSelector_spec.jsx | 1 -
 superset/assets/src/components/TableSelector.jsx                   | 7 ++-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/superset/assets/spec/javascripts/components/TableSelector_spec.jsx b/superset/assets/spec/javascripts/components/TableSelector_spec.jsx
index 8169d1d..d1febbf 100644
--- a/superset/assets/spec/javascripts/components/TableSelector_spec.jsx
+++ b/superset/assets/spec/javascripts/components/TableSelector_spec.jsx
@@ -145,7 +145,6 @@ describe('TableSelector', () => {
     it('should clear table options', () => {
       inst.fetchTables(true);
       expect(wrapper.state().tableOptions).toEqual([]);
-      expect(wrapper.state().filterOptions).toBeNull();
     });
 
     it('should fetch table options', () => {
diff --git a/superset/assets/src/components/TableSelector.jsx b/superset/assets/src/components/TableSelector.jsx
index dc5d075..b7783dd 100644
--- a/superset/assets/src/components/TableSelector.jsx
+++ b/superset/assets/src/components/TableSelector.jsx
@@ -19,7 +19,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 import Select from 'react-virtualized-select';
-import createFilterOptions from 'react-select-fast-filter-options';
 import { ControlLabel, Label } from 'react-bootstrap';
 import { t } from '@superset-ui/translation';
 import { SupersetClient } from '@superset-ui/connection';
@@ -70,7 +69,6 @@ export default class TableSelector extends React.PureComponent {
       dbId: props.dbId,
       schema: props.schema,
       tableName: props.tableName,
-      filterOptions: null,
     };
     this.changeSchema = this.changeSchema.bind(this);
     this.changeTable = this.changeTable.bind(this);
@@ -144,7 +142,6 @@ export default class TableSelector extends React.PureComponent {
             title: o.title,
           }));
           this.setState(() => ({
-            filterOptions: createFilterOptions({ options }),
             tableLoading: false,
             tableOptions: options,
           }));
@@ -155,7 +152,7 @@ export default class TableSelector extends React.PureComponent {
           this.props.handleError(t('Error while fetching table list'));
         });
     }
-     this.setState(() => ({ tableLoading: false, tableOptions: [], filterOptions: null
}));
+     this.setState(() => ({ tableLoading: false, tableOptions: [] }));
     return Promise.resolve();
   }
   fetchSchemas(dbId, force) {
@@ -277,10 +274,10 @@ export default class TableSelector extends React.PureComponent {
         name="select-table"
         ref="selectTable"
         isLoading={this.state.tableLoading}
+        ignoreAccents={false}
         placeholder={t('Select table or type table name')}
         autosize={false}
         onChange={this.changeTable}
-        filterOptions={this.state.filterOptions}
         options={options}
         value={this.state.tableName}
       />) : (


Mime
View raw message