codeant-ai-for-open-source[bot] commented on code in PR #43490:
URL: https://github.com/apache/superset/pull/43490#discussion_r3857012751
##########
superset/initialization/__init__.py:
##########
@@ -1002,11 +1005,14 @@ def _warn_if_retention_beat_missing(self) -> None:
"CeleryConfig or add the module to your override.",
self._RETENTION_TASK_MODULE,
)
- default_flags = self.config.get("DEFAULT_FEATURE_FLAGS", {})
- configured_flags = self.config.get("FEATURE_FLAGS", {})
- soft_delete_enabled = bool(
+ default_flags: dict[str, Any] =
self.config.get("DEFAULT_FEATURE_FLAGS", {})
+ configured_flags: dict[str, Any] = self.config.get("FEATURE_FLAGS", {})
+ soft_delete_enabled: bool = bool(
configured_flags.get("SOFT_DELETE",
default_flags.get("SOFT_DELETE", False))
)
+ audit_pruning_enabled: bool = (
+ self.config.get("PURGE_AUDIT_PRUNING_ENABLED", False) is True
+ )
Review Comment:
**Suggestion:** Invalid values such as the string `"true"` or integer `1`
are treated as disabled here because the diagnostic requires identity with the
singleton `True`. The task itself rejects these values as invalid and skips
pruning, but startup emits no warning about the invalid master switch or the
missing schedule, so an operator typo can leave audit pruning permanently
inactive without an actionable initialization warning. Validate and report
invalid non-boolean values separately before deciding whether to check the
schedule. [incorrect condition logic]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Startup diagnostics omit invalid pruning configuration.
- โ ๏ธ Missing audit-prune scheduling can remain unnoticed until beat
execution.
- โ ๏ธ Purge audit rows continue accumulating when pruning is inactive.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=654c34c392a047aea55d99f4688cd2df&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=654c34c392a047aea55d99f4688cd2df&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/initialization/__init__.py
**Line:** 1013:1015
**Comment:**
*Incorrect Condition Logic: Invalid values such as the string `"true"`
or integer `1` are treated as disabled here because the diagnostic requires
identity with the singleton `True`. The task itself rejects these values as
invalid and skips pruning, but startup emits no warning about the invalid
master switch or the missing schedule, so an operator typo can leave audit
pruning permanently inactive without an actionable initialization warning.
Validate and report invalid non-boolean values separately before deciding
whether to check the schedule.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43490&comment_hash=cd7bc418d4512ac3a999686b4cbefbae0158f1f056db743c2c63dfa152adde75&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43490&comment_hash=cd7bc418d4512ac3a999686b4cbefbae0158f1f056db743c2c63dfa152adde75&reaction=dislike'>๐</a>
--
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]