This file contains 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
import typing | |
import uuid | |
from dataclasses import dataclass | |
class InstanceWithId(typing.Protocol): | |
@property | |
def id(self) -> str: | |
... |
This file contains 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
import datetime as dt | |
from dataclasses import dataclass, field | |
import apischema | |
import pytest | |
def to_timestamp(d: dt.datetime) -> int: | |
return int(d.timestamp()) |
This file contains 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
import datetime as dt | |
import os | |
import motor | |
from beanie import Document, Indexed, PydanticObjectId, init_beanie, operators | |
from fastapi import FastAPI, Response, status | |
from pydantic import BaseModel | |
app = FastAPI() |
This file contains 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
""" | |
celery -A celery_error_callback_example.celery worker --loglevel=info | |
python celery_error_callback_example.py | |
""" | |
import time | |
from celery import Celery | |
celery = Celery( |