You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2026/04/23 17:37:40 UTC

(superset) 23/25: Fix lint

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

betodealmeida pushed a commit to branch backup/semantic-layer-rename-database-dataset-before-rebase-20260423-133321
in repository https://gitbox.apache.org/repos/asf/superset.git

commit b2784f297cadf06ff2b7e3916f38ccc60ae2d161
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Fri Apr 17 18:54:28 2026 -0400

    Fix lint
---
 superset-frontend/src/components/ListView/ListView.tsx | 9 ++++++---
 superset/daos/semantic_layer.py                        | 5 +++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/components/ListView/ListView.tsx b/superset-frontend/src/components/ListView/ListView.tsx
index 6a3e60f852c..b0fdabea83c 100644
--- a/superset-frontend/src/components/ListView/ListView.tsx
+++ b/superset-frontend/src/components/ListView/ListView.tsx
@@ -19,7 +19,7 @@
 import { t } from '@apache-superset/core/translation';
 import { Alert } from '@apache-superset/core/components';
 import { styled } from '@apache-superset/core/theme';
-import { useCallback, useEffect, useRef, useState, ReactNode } from 'react';
+import { useCallback, useEffect, useLayoutEffect, useRef, useState, ReactNode } from 'react';
 import cx from 'classnames';
 import TableCollection from '@superset-ui/core/components/TableCollection';
 import BulkTagModal from 'src/features/tags/BulkTagModal';
@@ -349,9 +349,12 @@ export function ListView<T extends object = any>({
   }>(null);
 
   // Wire the optional external filtersRef to our internal filterControlsRef.
-  useEffect(() => {
+  // useLayoutEffect fires synchronously after DOM mutations, guaranteeing the
+  // ref is populated before the first paint and after every update.
+  useLayoutEffect(() => {
     if (filtersRef) {
-      (filtersRef as any).current = filterControlsRef.current;
+      (filtersRef as React.MutableRefObject<typeof filterControlsRef.current>).current =
+        filterControlsRef.current;
     }
   });
 
diff --git a/superset/daos/semantic_layer.py b/superset/daos/semantic_layer.py
index c92745bd119..424a4cdbc3d 100644
--- a/superset/daos/semantic_layer.py
+++ b/superset/daos/semantic_layer.py
@@ -34,12 +34,13 @@ from superset.utils import json
 
 
 class SemanticLayerDAO(BaseDAO[SemanticLayer], AbstractSemanticLayerDAO):
-    # SemanticLayer uses uuid as the primary key
-    id_column_name = "uuid"
     """
     Data Access Object for SemanticLayer model.
     """
 
+    # SemanticLayer uses uuid as the primary key
+    id_column_name = "uuid"
+
     model_cls = SemanticLayer
 
     @staticmethod