villebro commented on code in PR #32699:
URL: https://github.com/apache/superset/pull/32699#discussion_r1999147340


##########
superset/tasks/scheduler.py:
##########
@@ -124,8 +124,10 @@ def prune_log() -> None:
         logger.exception("An exception occurred while pruning report schedule 
logs")
 
 
-@celery_app.task(name="prune_query")
-def prune_query(retention_period_days: Optional[int] = None) -> None:
+@celery_app.task(name="prune_query", bind=True)
+def prune_query(
+    self: Task, retention_period_days: Optional[int] = None, **kwargs: Any

Review Comment:
   nit: could we `from __future__ import annotations` to get rid of `Optional` 
(IIRC, it's required to change to `| None` notation)?



##########
superset/commands/logs/prune.py:
##########
@@ -69,7 +69,7 @@ def run(self) -> None:
 
         total_rows = len(ids_to_delete)
 
-        logger.info("Total rows to be deleted: %s", total_rows)
+        logger.info("Total rows to be deleted: %s", f"{total_rows:,}")

Review Comment:
   optional thought: it could be a good idea to have a `prettify_number` or 
similar to centralize this logic, with a few unit tests to verify/demonstrate 
how the value is formatted.



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