Open pydanny opened 3 weeks ago
This script doesn't appear to work:
from fastlite import * db = Database(':memory:') print('original') class User: name: str; age: int print(User.__annotations__) users = db.create(User, pk='name') print(users.__repr__()) print('-'*20) # Transform! print('transformation to add pwd:str field') class User: name: str; age: int; pwd: str print(User.__annotations__) users2 = db.create(User, pk='name', transform=True) print(users2.__repr__())
This should return this string:
original {'name': <class 'str'>, 'age': <class 'int'>} <Table user (name, age)> -------------------- transform {'name': <class 'str'>, 'age': <class 'int'>, 'pwd': <class 'str'>} <Table user (name, age, pwd)>
Instead, it returns this:
original {'name': <class 'str'>, 'age': <class 'int'>} <Table user (name, age)> -------------------- transform {'name': <class 'str'>, 'age': <class 'int'>, 'pwd': <class 'str'>} <Table user (name, age)> # <----------------------------------------- missing pwd
Additionally, this doesn't work in index.ipynb of this repo. Add this to the bottom cell:
index.ipynb
class Cat: id:int; name:str; weight:float; uid:int; breed:str cats = db.create(Cat, transform=True) cats
The result that should be returned is missing fields, specifically uid and breed:
uid
breed
<Table cat (id, name, weight)>
This script doesn't appear to work:
This should return this string:
Instead, it returns this:
Additionally, this doesn't work in
index.ipynb
of this repo. Add this to the bottom cell:The result that should be returned is missing fields, specifically
uid
andbreed
: