This is an automated email from the ASF dual-hosted git repository.

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

commit 078af1173ab20135f6b3e57c5913e1aff86417e2
Author: Erik Ritter <[email protected]>
AuthorDate: Mon Sep 16 21:05:58 2019 -0700

    [SQL Lab] Fix bug when filtering on results that include nulls (#8231)
---
 .../javascripts/components/FilterableTable/FilterableTable_spec.jsx    | 3 ++-
 superset/assets/src/components/FilterableTable/FilterableTable.jsx     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/superset/assets/spec/javascripts/components/FilterableTable/FilterableTable_spec.jsx
 
b/superset/assets/spec/javascripts/components/FilterableTable/FilterableTable_spec.jsx
index 73837b6..d792f47 100644
--- 
a/superset/assets/spec/javascripts/components/FilterableTable/FilterableTable_spec.jsx
+++ 
b/superset/assets/spec/javascripts/components/FilterableTable/FilterableTable_spec.jsx
@@ -26,6 +26,7 @@ describe('FilterableTable', () => {
     data: [
       { a: 'a1', b: 'b1', c: 'c1', d: 0 },
       { a: 'a2', b: 'b2', c: 'c2', d: 100 },
+      { a: null, b: 'b3', c: 'c3', d: 50 },
     ],
     height: 500,
   };
@@ -38,7 +39,7 @@ describe('FilterableTable', () => {
   });
   it('renders a grid with 2 Table rows', () => {
     expect(wrapper.find('.ReactVirtualized__Grid')).toHaveLength(1);
-    expect(wrapper.find('.ReactVirtualized__Table__row')).toHaveLength(2);
+    expect(wrapper.find('.ReactVirtualized__Table__row')).toHaveLength(3);
   });
   it('renders a grid with 2 Grid rows for wide tables', () => {
     const wideTableColumns = MAX_COLUMNS_FOR_TABLE + 1;
diff --git a/superset/assets/src/components/FilterableTable/FilterableTable.jsx 
b/superset/assets/src/components/FilterableTable/FilterableTable.jsx
index e68c998..ba80dfb 100644
--- a/superset/assets/src/components/FilterableTable/FilterableTable.jsx
+++ b/superset/assets/src/components/FilterableTable/FilterableTable.jsx
@@ -209,7 +209,7 @@ export default class FilterableTable extends PureComponent {
         const cellValue = row[key];
         if (typeof cellValue === 'string') {
           values.push(cellValue.toLowerCase());
-        } else if (typeof cellValue.toString === 'function') {
+        } else if (cellValue !== null && typeof cellValue.toString === 
'function') {
           values.push(cellValue.toString());
         }
       }

Reply via email to