Skip to content

Commit

Permalink
chore: change docstrings + set mode json for better object dumps (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
KatantDev authored Mar 14, 2024
1 parent 9d8604f commit ed37be4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion taskiq/abc/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ def loadb(self, value: bytes) -> Any:
"""
Parse byte-encoded value received from the wire.
:param message: value to parse.
:param value: value to decode.
:return: decoded value.
"""
2 changes: 1 addition & 1 deletion taskiq/api/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def run_receiver_task(
:param max_prefetch: maximum number of tasks to prefetch.
:param propagate_exceptions: whether to propagate exceptions in generators or not.
:param run_startup: whether to run startup function or not.
:param ack_time: acknowledge type to use.
:raises asyncio.CancelledError: if the task was cancelled.
"""

Expand Down
2 changes: 1 addition & 1 deletion taskiq/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def model_validate(
return model_class.model_validate(message)

def model_dump(instance: Model) -> Dict[str, Any]:
return instance.model_dump()
return instance.model_dump(mode="json")

def model_validate_json(
model_class: Type[Model],
Expand Down
2 changes: 1 addition & 1 deletion taskiq/scheduler/merge_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def only_new(
"""
This function preserves only new schedules.
:param old_tasks: previously discovered tasks.
:param _old_tasks: previously discovered tasks.
:param new_tasks: newly discovered schedules.
:return: list of new schedules.
"""
Expand Down
1 change: 1 addition & 0 deletions taskiq/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async def on_ready(self, source: "ScheduleSource", task: ScheduledTask) -> None:
This method is called when task is ready to be enqueued.
It's triggered on proper time depending on `task.cron` or `task.time` attribute.
:param source: source that triggered this event.
:param task: task to send
"""
try:
Expand Down

0 comments on commit ed37be4

Please sign in to comment.