korbit-ai[bot] commented on code in PR #32511: URL: https://github.com/apache/superset/pull/32511#discussion_r1980982612
########## superset/tasks/scheduler.py: ########## @@ -123,13 +124,20 @@ def prune_log() -> None: @celery_app.task(name="prune_query") -def prune_query() -> None: +def prune_query(retention_period_days: Optional[int] = None) -> None: Review Comment: ### Missing retention period validation <sub></sub> <details> <summary>Tell me more</summary> ###### What is the issue? The task accepts negative integers or zero as valid retention periods, which could lead to unintended data loss. ###### Why this matters Without validation, negative or zero values could cause immediate deletion of all queries or other unexpected behavior. ###### Suggested change ∙ *Feature Preview* Add validation for the retention period value. Example: ```python @celery_app.task(name="prune_query") def prune_query(retention_period_days: Optional[int] = None) -> None: if retention_period_days is not None and retention_period_days <= 0: raise ValueError("retention_period_days must be a positive integer") ``` </details> <sub> [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/d72d0e02-ad88-44ae-ba3b-dada3e5b52e8?suggestedFixEnabled=true) 💬 Chat with Korbit by mentioning @korbit-ai. </sub> <!--- korbi internal id:047a6d9a-816b-4214-9573-ae81043df7d8 --> -- 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]
