korbit-ai[bot] commented on code in PR #32699:
URL: https://github.com/apache/superset/pull/32699#discussion_r1998851258
##########
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: Celery.task, retention_period_days: Optional[int] = None, **kwargs
+) -> None:
Review Comment:
### Incorrect Celery Task Type Hint <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The type hint 'Celery.task' for the 'self' parameter is incorrect. It should
be 'celery.Task'.
###### Why this matters
Using incorrect type hints can mislead developers and cause confusion during
code review or when using IDE features.
###### Suggested change ∙ *Feature Preview*
```python
from celery import Task
@celery_app.task(name="prune_query", bind=True)
def prune_query(
self: Task, retention_period_days: Optional[int] = None, **kwargs
) -> None:
```
</details>
<sub>
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/5770b01c-823e-47f6-a22b-e7461a4e9452?suggestedFixEnabled=true)
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:65385aa3-c5aa-46e3-81ce-a9e15029594a -->
--
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]