Repository navigation
docs: describe on_schedule as a Cloud Scheduler trigger - #321
Draft
IzaakGough wants to merge 1 commit into
Draft
IzaakGough wants to merge 1 commit into
IzaakGough wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request corrects typos and outdated descriptions in the docstrings of src/firebase_functions/scheduler_fn.py, ensuring that the on_schedule function and ScheduledEvent class are documented accurately. The reviewer recommends improving the Sphinx documentation syntax by replacing the exception role :exc: with :class: and :obj: for the ScheduledEvent class and None singleton respectively.
| :type \\*\\*kwargs: as :exc:`firebase_functions.options.ScheduleOptions` | ||
| :rtype: :exc:`typing.Callable` | ||
| \\[ \\[ :exc:`firebase_functions.schedule_fn.ScheduledEvent` \\], :exc:`None` \\] | ||
| \\[ \\[ :exc:`firebase_functions.scheduler_fn.ScheduledEvent` \\], :exc:`None` \\] |
Contributor
There was a problem hiding this comment.
The Sphinx role :exc: is used to reference exceptions. Since ScheduledEvent is a class and None is a singleton object, they should be referenced using :class: and :obj: respectively instead of :exc:.
Suggested change
| \\[ \\[ :exc:`firebase_functions.scheduler_fn.ScheduledEvent` \\], :exc:`None` \\] | |
| \\[ \\[ :class:`firebase_functions.scheduler_fn.ScheduledEvent` \\], :obj:`None` \\] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
on_scheduleAPI reference said it handles Cloud Tasks and takes aCallableRequest. It actually runs on a Cloud Scheduler job and takes aScheduledEvent.This corrects that docstring, the broken
ScheduledEventlink in its return type, and a typo in theScheduledEventdocstring.Tested by building the docs locally and running the docstring example. Not tested with the CI docs script.