Skip to content

Commit

Permalink
chore(native-filters): Fetch only the dataset columns
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed Mar 7, 2023
1 parent f7e7652 commit 31a91aa
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 31a91aa

Please sign in to comment.