mikebridge commented on code in PR #40130:
URL: https://github.com/apache/superset/pull/40130#discussion_r3344697904


##########
superset/commands/dataset/restore.py:
##########
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Command to restore a soft-deleted dataset."""
+
+import logging
+

Review Comment:
   Fixed in 0591115434 — unused `logger = logging.getLogger(__name__)` 
declaration and its `import logging` removed from 
`commands/dataset/restore.py`. The command does no logging; the cargo was 
carried from sibling files.



##########
superset/datasets/filters.py:
##########
@@ -51,3 +53,10 @@ def apply(self, query: Query, value: bool) -> Query:
                 )
             )
         return query
+
+
+class DatasetDeletedStateFilter(BaseDeletedStateFilter):  # pylint: 
disable=too-few-public-methods
+    """Rison filter for the GET list that exposes soft-deleted datasets."""
+
+    arg_name = "dataset_deleted_state"
+    model = SqlaTable

Review Comment:
   Declining — the parent class `BaseDeletedStateFilter` (in 
`superset/views/filters.py`) already declares the abstract `model: 
ClassVar[type[SoftDeleteMixin]]`. The subclass assignment `model = SqlaTable` 
is type-checked against that annotation by mypy without needing a redundant 
re-declaration. The sibling `ChartDeletedStateFilter` and 
`DashboardDeletedStateFilter` follow the same bare-assignment pattern, and mypy 
passes on all three.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to