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
transform
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)>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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
:The text was updated successfully, but these errors were encountered: