We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# from dataclasses import field from pydantic.dataclasses import dataclass from typing import List from datetime import datetime from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String, ARRAY, TIMESTAMP from sqlalchemy.orm import sessionmaker, mapper metadata = MetaData() person_table = \ Table('people', metadata, Column('id', Integer, primary_key=True, autoincrement=True), Column('name', String(255)), Column('age', Integer), Column('hobbies', String), Column('birthday', TIMESTAMP) ) @dataclass class Person: id: int = None name: str = '' age: int = 0 hobbies: str = None birthday: datetime = None mapper(Person, person_table) engine = create_engine("sqlite:///", echo=True) metadata.create_all(engine) session = sessionmaker(bind=engine)() person = Person(id=None, name='Robby', age=33, hobbies="golf", birthday=datetime(1985, 7, 25)) session.add(person) session.commit()
this works if i replace pydantic dataclasses with standard python dataclasses.
how can this be fixed ?
The text was updated successfully, but these errors were encountered:
im closing this myself, since i saw #1089 and understand that this is a known WONTFIX issue
Sorry, something went wrong.
pydantic.dataclasses.dataclass
No branches or pull requests
this works if i replace pydantic dataclasses with standard python dataclasses.
how can this be fixed ?
The text was updated successfully, but these errors were encountered: