AlexanderPodorov
AlexanderPodorov
@jianyuan , I had the same problem. I'm using the following solution: ```python def coroutine(function: Callable): @wraps(function) def wrapper(*args, **kwargs): asyncio.run(function(*args, **kwargs)) return wrapper @celery.task @coroutine async def execute_task(): #...
@himbeles , thank you! Unfortunately your fix won't work since in my case such a statement is problematic: ```python obj_dict = dataclasses.asdict(obj) ``` It grabs all `dataclass` fields into the...
I have no hope that this is going to be fixed someday, especially for reason that it could affect new `dataclass` related features. So I will explicitly convert my `dataclass`...
@Lunrtick , I think a bool flag like that is not a good solution. It would be nicer to call `from_orm` of `pydantic` somehow internally when the response is created....
@Lunrtick yes, I think it's a bit better. And yes, I think it's fine to have a custom dunder class attribute. SQLAlchemy relies on them too (`__tablename__`, `__table_args__`, etc.), so...
@tiangolo , thanks for your great work and FastAPI! I don't see a good way of address this issue either. AFAIK SQLAlchemy fully supports `dataclasses` related functionality, however there are...
Thanks for the comments @tiangolo ! SQLAlchemy actually supports `dataclasses.asdict`. The quirk here is that when we define a relationship attribute with `lazy="raise"` (we don't need this relationship to be...
@princematheww , I'm using the setup pretty similar to yours: `pet_type: Literal[PetType.CAT]`. If you're using python 3.11, just replace `Enum` with built-in `StrEnum` and it will work as expected.
Hi, Yeah, the minimal change would be: ```python def self_group(self, against: Any = None) -> Any: ``` However a precise type would be nicer. I'm not sure which type would...
Because of the untyped signature: ```python def self_group(self, against = None): ``` `is partially unknown` essentially means that some type hints are missing. Anything which is missing a type is...