You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2023/03/07 21:11:30 UTC
[superset] 01/01: chore(native-filters): Fetch only the dataset columns
This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch john-bodley--native-filters-dataset-columns
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 05f38c1ccae558de3a248a48d047715bab3717ea
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Wed Mar 8 10:11:20 2023 +1300
chore(native-filters): Fetch only the dataset columns
---
.../FiltersConfigForm/ColumnSelect.tsx | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
index 41c591ade3..a1adf6cdf4 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
@@ -17,6 +17,7 @@
* under the License.
*/
import React, { useCallback, useState, useMemo, useEffect } from 'react';
+import rison from 'rison';
import { Column, ensureIsArray, SupersetClient, t } from '@superset-ui/core';
import { useChangeEffect } from 'src/hooks/useChangeEffect';
import { Select, FormInstance } from 'src/components';
@@ -98,7 +99,26 @@ export function ColumnSelect({
}
if (datasetId != null) {
cachedSupersetGet({
- endpoint: `/api/v1/dataset/${datasetId}`,
+ endpoint: `/api/v1/dataset/${datasetId}?q=${rison.encode(
+ columns: [
+ "columns.advanced_data_type",
+ "columns.changed_on",
+ "columns.column_name",
+ "columns.created_on",
+ "columns.description",
+ "columns.expression",
+ "columns.filterable",
+ "columns.groupby",
+ "columns.id",
+ "columns.is_active",
+ "columns.extra",
+ "columns.is_dttm",
+ "columns.python_date_format",
+ "columns.type",
+ "columns.uuid",
+ "columns.verbose_name",
+ ],
+ )}`,
}).then(
({ json: { result } }) => {
const lookupValue = Array.isArray(value) ? value : [value];