You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2023/03/16 14:39:40 UTC

[GitHub] [superset] michael-s-molina commented on a diff in pull request #23303: chore(native-filters): Fetch only the required dataset fields

michael-s-molina commented on code in PR #23303:
URL: https://github.com/apache/superset/pull/23303#discussion_r1138681583


##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx:
##########
@@ -85,7 +86,9 @@ export function ColumnSelect({
     }
     if (datasetId != null) {
       cachedSupersetGet({
-        endpoint: `/api/v1/dataset/${datasetId}`,
+        endpoint: `/api/v1/dataset/${datasetId}?q=${rison.encode({

Review Comment:
   The `columns` state is later used  to get `currentColumn` which is then passed to the `filterValues` function. If you check `filterValues` references, you will see that `is_dttm` and `type_generic` attributes are also used.



##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx:
##########
@@ -654,7 +655,20 @@ const FiltersConfigForm = (
   useEffect(() => {
     if (datasetId) {
       cachedSupersetGet({
-        endpoint: `/api/v1/dataset/${datasetId}`,
+        endpoint: `/api/v1/dataset/${datasetId}?q=${rison.encode({
+          columns: [

Review Comment:
   I found other attributes that need to be queried when analyzing the following files:
   
   https://github.com/apache/superset/blob/da3791ad3daa209631a588394600d1a8b635e814/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx#L138
   
   ```
   database.id
   datasource_name
   schema
   is_sqllab_view
   ```
   
   https://github.com/apache/superset/blob/da3791ad3daa209631a588394600d1a8b635e814/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx#L121
   
   ```
   columns.type
   ```
   
   https://github.com/apache/superset/blob/da3791ad3daa209631a588394600d1a8b635e814/superset-frontend/packages/superset-ui-chart-controls/src/utils/getTemporalColumns.ts#L43
   
   ```
   columns.is_dttm
   columns.name
   main_dttm_col
   ```
   
   https://github.com/apache/superset/blob/0c454c64426376d7fb209a8b16d15c580be811f4/superset-frontend/packages/superset-ui-chart-controls/src/types.ts#L482
   
   ```
   results
   sql
   ```



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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