Skip to content

Conversation

@jcnecio
Copy link
Contributor

@jcnecio jcnecio commented May 18, 2022

Changes included in the PR for issue #3038 - closes #3038:

  • Updated docstring of JobQueue.run_daily that the days parameter range 0-6 is now sunday-saturday.
  • Added a warning message to double check if the parameter is still correct.
  • Added a test case to check if the new number scheme is correctly scheduled.
  • Updated test cases where the warning should be visible on call.

Checklist for PRs

  • Added .. versionadded:: version, .. versionchanged:: version or .. deprecated:: version to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
  • Created new or adapted existing unit tests
  • merge master into this branch to verify that pre-commit checks out

@jcnecio jcnecio changed the title Aligned JobQueue.run_daily days parameter with cron weekdays notation (#3038) Aligned JobQueue.run_daily days parameter with cron weekdays notation. May 18, 2022
Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

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

Thanks for the nice PR! It looks good overall 👍 The comments I left below are mostly just small stuff :)

Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

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

just one nitpick :) please also merge the master branch into yours - we changed the pre-commit settings a bit so we should make sure that your branch passes the updated version as well

@Bibo-Joshi Bibo-Joshi requested a review from Poolitzer May 23, 2022 17:00
Comment on lines +456 to +460
warn(
"Prior to v20.0 the `days` parameter was not aligned to that of cron's weekday scheme."
"We recommend double checking if the passed value is correct.",
stacklevel=2,
)
Copy link
Member

Choose a reason for hiding this comment

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

What about a comment here, reminding us that we remove this in the next major version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this enough?

        # TODO: After v20.0, we should remove the this warning.

Copy link
Member

Choose a reason for hiding this comment

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

should be enough IMO, yes :)

Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

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

Code LGTM

@Bibo-Joshi Bibo-Joshi merged commit 349baa0 into python-telegram-bot:master May 25, 2022
@Bibo-Joshi
Copy link
Member

Thank you for the contribution! :)

@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjust weekday behavior of JobQueue.run_daily

3 participants