codeant-ai-for-open-source[bot] commented on code in PR #44431:
URL: https://github.com/apache/superset/pull/44431#discussion_r4075993337
##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/PartitionMappingSection.tsx:
##########
@@ -178,7 +184,16 @@ export default function PartitionMappingSection({
</Flex>
<Input
value={transform}
- onChange={event => onChange?.(event.target.value || null)}
+ onChange={event => {
+ const next = event.target.value || null;
+ onChange?.(next);
+ // Monotonicity is a property of the expression, so editing the
+ // transform re-opens the question. The identity `:value` provably
+ // preserves ordering and stays auto-declared; anything else is the
+ // owner's to declare, and editing away from `:value` must not
leave
+ // a stale auto-check behind.
+ onMonotonicChange(columnName, next === IDENTITY_TRANSFORM);
Review Comment:
✅ **Customized review instruction saved!**
**Instruction:**
> When a transform expression is edited away from the auto-managed `:value`
identity, reset the monotonicity declaration rather than preserving a
potentially stale explicit `true`.
**Applied to:**
-
`superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/PartitionMappingSection.tsx`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
##########
superset/db_engine_specs/base.py:
##########
@@ -722,6 +722,17 @@ def get_extended_aggregation_func(
# editor offers no pre-fill and the owner writes the transform themselves.
partition_value_transform_default: str | None = None
+ # Whether the dataset editor should offer partition filter mapping at all.
+ # This is a structural property of the engine, not a pre-fill: mapping a
+ # filter onto a physical partition column only prunes work on engines whose
+ # tables are laid out as partition directories (Hive-family). Elsewhere the
+ # concept either does not exist (Postgres) or is handled invisibly by the
+ # engine (Snowflake micro-partitions, BigQuery/Redshift internals), so the
+ # dropdown would be clutter that maps to nothing. Default `False` so an
+ # engine only advertises the feature by opting in, rather than inheriting
it
+ # and having to remember to opt out.
+ supports_partition_filter_mapping: bool = False
Review Comment:
✅ **Customized review instruction saved!**
**Instruction:**
> Only enable partition filter mapping for database engines with explicitly
validated partition-directory support and partition value transform defaults;
do not expand coverage to other partition-capable engines without separate
validation.
**Applied to:**
- `superset/db_engine_specs/base.py`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
--
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]