Skip to content

Annotate celery/exceptions.py#7396

Closed
Kludex wants to merge 9 commits intocelery:mainfrom
Kludex:annotate/celery/exceptions.py
Closed

Annotate celery/exceptions.py#7396
Kludex wants to merge 9 commits intocelery:mainfrom
Kludex:annotate/celery/exceptions.py

Conversation

@Kludex
Copy link
Copy Markdown
Contributor

@Kludex Kludex commented Apr 2, 2022

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Apr 2, 2022

This pull request introduces 2 alerts when merging 51c289e into fbda008 - view on LGTM.com

new alerts:

  • 1 for Non-exception in 'except' clause
  • 1 for Module is imported with 'import' and 'import from'

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.98%. Comparing base (1ccd887) to head (4d8b579).
Report is 847 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7396      +/-   ##
==========================================
- Coverage   89.30%   86.98%   -2.32%     
==========================================
  Files         138      148      +10     
  Lines       16762    18464    +1702     
  Branches     2451     2943     +492     
==========================================
+ Hits        14969    16061    +1092     
- Misses       1561     2124     +563     
- Partials      232      279      +47     
Flag Coverage Δ
unittests 86.95% <100.00%> (-2.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@auvipy auvipy self-requested a review April 3, 2022 03:48
Copy link
Copy Markdown
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase & would be great if some unit test coverage can be increased

@Kludex
Copy link
Copy Markdown
Contributor Author

Kludex commented Apr 3, 2022

I don't want to add tests on those PRs, as I'm not including any functionally I don't think it makes sense (or is fair).

That being said... I'm willing to create a plan to increase the coverage of the whole project to 100%, analogous to the plan created to add annotations (progressive, and by file(s)). I did Kludex/uvicorn#102 for uvicorn.

If you agree, I can create a similar issue, and setup for it as well (so the coverage doesn't drop, only goes up).

@Kludex Kludex requested a review from auvipy April 3, 2022 05:00
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Apr 3, 2022

This pull request fixes 1 alert when merging a516751 into 314d014 - view on LGTM.com

fixed alerts:

  • 1 for Non-exception in 'except' clause

Comment on lines -152 to -153
#: Time of retry (ETA), either :class:`numbers.Real` or
#: :class:`~datetime.datetime`.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed part of the comment, as it's annotated now, but I'm not sure if it has side effects on the docs?

#: :class:`~datetime.datetime`.
when = None
#: Time of retry (ETA)
when: Optional[Union[datetime, numbers.Number]] = None
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used numbers.Number instead of numbers.Real because there's a conditional on humanize() to check if it's an instance of numbers.Number. I can change it tho.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can leave it like that, but keep the original doc with the :class:numbers.Real doc, being a more specialized doc compared to the "general" annotation as numbers.Number.

What do you think?

"""An issue writing to the backend."""

def __init__(self, *args, **kwargs):
def __init__(self, *args: str, **kwargs: str) -> None:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several options here:

  • Use Unpack (provided on PEP 646 via typing_extensions).
  • Just replace **kwargs to state: str, task_id: str - This is considered a breaking change, and I don't want to do anything besides annotating.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Apr 3, 2022

This pull request introduces 1 alert when merging 4817496 into 1ccd887 - view on LGTM.com

new alerts:

  • 1 for Unused import

GautamDhiman
GautamDhiman approved these changes Dec 27, 2022
@auvipy auvipy requested a review from a team December 29, 2022 05:33
Copy link
Copy Markdown
Member

@Nusnus Nusnus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment but not something critical to change, food for thought.
Besides, LGTM too.

#: :class:`~datetime.datetime`.
when = None
#: Time of retry (ETA)
when: Optional[Union[datetime, numbers.Number]] = None
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can leave it like that, but keep the original doc with the :class:numbers.Real doc, being a more specialized doc compared to the "general" annotation as numbers.Number.

What do you think?

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
@Kludex Kludex closed this by deleting the head repository Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants