Copilot commented on code in PR #36313:
URL: https://github.com/apache/superset/pull/36313#discussion_r2578230048
##########
superset/commands/logs/prune.py:
##########
@@ -39,13 +39,19 @@ class LogPruneCommand(BaseCommand):
Attributes:
retention_period_days (int): The number of days for which records
should be retained.
Records older than this period will be
deleted.
+ max_rows_per_run (int | None): The maximum number of rows to delete in
a single run.
+ If provided and greater than zero, only
up to this
+ many rows are targeted in this
execution.
""" # noqa: E501
- def __init__(self, retention_period_days: int):
+ def __init__(self, retention_period_days: int, max_rows_per_run: int |
None = None):
Review Comment:
The `max_rows_per_run` parameter lacks validation for negative values. While
the code checks if it's greater than zero before applying the limit (line 69),
negative values would be silently ignored. Consider adding validation in the
`__init__` method or the `validate()` method to raise an error if a negative
value is provided, ensuring clear feedback to users.
##########
superset/commands/logs/prune.py:
##########
@@ -39,13 +39,19 @@ class LogPruneCommand(BaseCommand):
Attributes:
retention_period_days (int): The number of days for which records
should be retained.
Records older than this period will be
deleted.
+ max_rows_per_run (int | None): The maximum number of rows to delete in
a single run.
+ If provided and greater than zero, only
up to this
+ many rows are targeted in this
execution.
Review Comment:
Inconsistent indentation in the docstring. Line 44 has extra indentation (12
spaces) compared to line 43 (9 spaces). Both should align consistently for
proper formatting.
```suggestion
many rows are targeted in this
execution.
```
--
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]