bito-code-review[bot] commented on code in PR #43757:
URL: https://github.com/apache/superset/pull/43757#discussion_r4113987794


##########
superset/connectors/sqla/models.py:
##########
@@ -1915,8 +1947,48 @@ def data(self) -> ExplorableData:
             data_["extra"] = self.extra
             data_["always_filter_main_dttm"] = self.always_filter_main_dttm
             data_["normalize_columns"] = self.normalize_columns
+            data_["partition_column"] = self.partition_column
+            data_["partition_mapped_column"] = self.partition_mapped_column
+            data_["partition_filter_mapping"] = 
self.partition_filter_mapping_summary
         return data_
 
+    @property
+    def partition_filter_mapping_summary(self) -> dict[str, Any] | None:
+        """
+        Self-contained summary of the mapping for the Explore indicator.
+
+        Deliberately not a lookup into `columns`: `data_for_slices` prunes
+        columns no chart references, and the partition column is typically
+        referenced by none of them, so anything reading it out of
+        `datasource.columns` would work in Explore and break on dashboards.
+
+        `active` is the save path's own verdict rather than an approximation of
+        it. A transform that fails validation -- one missing `:value`, one that
+        does not parse -- is saved inactive on purpose, so a cheaper signal 
here
+        would advertise a mapping that never mirrors a filter. The parse this
+        costs is memoized on `(transform, engine)` in `is_transform_active`, 
and
+        datasets without a partition column never reach it.
+        """
+        if not self.partition_column:
+            return None

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Summary ignores feature flag</b></div>
   <div id="fix">
   
   `data` unconditionally serializes `partition_filter_mapping_summary`, but 
the feature is flag-gated (`FEATURE_FLAG = "PARTITION_FILTER_MAPPING"` in 
`partition_mapping.py`) and the save path validates only when enabled. With the 
flag off, every dataset payload still carries the mapping summary. Consider 
gating the property on the flag for a stable contract.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #79e123</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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