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>![category 
Readability](https://img.shields.io/badge/Readability-0284c7)</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>
   
   [![Report a problem with this 
comment](https://img.shields.io/badge/Report%20a%20problem%20with%20this%20comment-gray.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmNWVjMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10cmlhbmdsZS1hbGVydCI+PHBhdGggZD0ibTIxLjczIDE4LTgtMTRhMiAyIDAgMCAwLTMuNDggMGwtOCAxNEEyIDIgMCAwIDAgNCAyMWgxNmEyIDIgMCAwIDAgMS43My0zIi8+PHBhdGggZD0iTTEyIDl2NCIvPjxwYXRoIGQ9Ik0xMiAxN2guMDEiLz48L3N2Zz4=)](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]

Reply via email to