Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify return values of ..._on_commit methods #8984

Merged
merged 5 commits into from Apr 29, 2024

Conversation

browniebroke
Copy link
Contributor

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

Clarify return values for delay_on_commit and apply_async_on_commit in the code and in the documentation.

Fix #8976

Copy link

codecov bot commented Apr 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.81%. Comparing base (04af085) to head (0cc735b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8984      +/-   ##
==========================================
- Coverage   77.81%   77.81%   -0.01%     
==========================================
  Files         150      150              
  Lines       18686    18686              
  Branches     3193     3193              
==========================================
- Hits        14541    14540       -1     
  Misses       3854     3854              
- Partials      291      292       +1     
Flag Coverage Δ
unittests 77.79% <100.00%> (-0.01%) ⬇️

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.

@browniebroke browniebroke changed the title Clarify returne values of ..._on_commit methods Clarify return values of ..._on_commit methods Apr 28, 2024
@Nusnus
Copy link
Member

Nusnus commented Apr 28, 2024

@browniebroke Fixed the issues in main that broke this PR, also fixed a typo.

I’m thinking out loud about merging this and releasing a patch version (v5.4.1), WDYT?

The API originally did not return None? a.k.a API change? Or is it a stretch to call this an API change 🤔

@Nusnus Nusnus added this to the 5.4.x milestone Apr 28, 2024
@FraCata00
Copy link
Contributor

@browniebroke now it's more understandable than before 🚀

@FraCata00
Copy link
Contributor

FraCata00 commented Apr 29, 2024

@browniebroke Fixed the issues in main that broke this PR, also fixed a typo.

I’m thinking out loud about merging this and releasing a patch version (v5.4.1), WDYT?

The API originally did not return None? a.k.a API change? Or is it a stretch to call this an API change 🤔

No way, is too much a "API change"?
although is not a different return, is a clarify return

@browniebroke
Copy link
Contributor Author

The API originally did not return None? a.k.a API change? Or is it a stretch to call this an API change 🤔

It did return None, it's just that there was a return statement, and the None was coming from the underlying Django API. Now, the Celery method doesn't return anything, making it more explicit.

I’m thinking out loud about merging this and releasing a patch version (v5.4.1), WDYT?

I don't think there is any rush to release a fix for this, the behaviour hasn't actually changed. The main change is in the docs IMO.

@Nusnus
Copy link
Member

Nusnus commented Apr 29, 2024

Yup, you two are right - I didn't notice the nuance.

Thank you for collaborating to fine tune the API!

@Nusnus Nusnus merged commit 90ff2e1 into celery:main Apr 29, 2024
81 of 82 checks passed
@browniebroke browniebroke deleted the fix/delay-on-commit-return-value branch April 29, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Django task with transaction atomic, return None instead of the task UUID
4 participants