Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/firebase_functions/scheduler_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@_dataclasses.dataclass(frozen=True)
class ScheduledEvent:
"""
A ``ScheduleEvent`` that is passed to the function handler.
A ``ScheduledEvent`` that is passed to the function handler.
"""

job_name: str | None
Expand All @@ -69,8 +69,8 @@ class ScheduledEvent:
@_util.copy_func_kwargs(_options.ScheduleOptions)
def on_schedule(**kwargs) -> _typing.Callable[[_C], _Response]:
"""
Creates a handler for tasks sent to a Google Cloud Tasks queue.
Requires a function that takes a ``CallableRequest``.
Creates a handler that runs on a schedule, triggered by a Cloud Scheduler job.
Requires a function that takes a ``ScheduledEvent``.

Example:

Expand All @@ -91,7 +91,7 @@ def example(event: scheduler_fn.ScheduledEvent) -> None:
:param \\*\\*kwargs: `ScheduleOptions` options.
: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` \\]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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` \\]

A function that takes a ``ScheduledEvent`` and returns nothing.
"""
options = _options.ScheduleOptions(**kwargs)
Expand Down
Loading