File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1+ from typing import List , Optional , TYPE_CHECKING
12from sqlalchemy import String , JSON
3+ from sqlalchemy .orm import DeclarativeBase , Mapped , mapped_column
24from .database import database
35import uuid
4- from typing import Type
56
7+ class Base (DeclarativeBase ):
8+ pass
69
7- class Data (database .Model ):
10+ if TYPE_CHECKING :
11+ from sqlalchemy .orm import DeclarativeBase
12+
13+ class Data (Base ):
814 __tablename__ = "datas"
915
10- id = database . Column (
16+ id : Mapped [ str ] = mapped_column (
1117 String , primary_key = True , default = lambda : str (uuid .uuid4 ()).replace ("-" , "" )
1218 )
1319 name = database .Column (String , nullable = False )
@@ -24,7 +30,7 @@ def create(
2430 geode_object : str ,
2531 input_file : str ,
2632 additional_files : list [str ]
27- ) -> Type [ "Data" ] :
33+ ) -> "Data" :
2834 if input_file is None :
2935 input_file = []
3036 if additional_files is None :
@@ -37,7 +43,7 @@ def create(
3743 additional_files = additional_files ,
3844 native_file_name = "" ,
3945 viewable_file_name = "" ,
40- light_viewable = "" ,
46+ light_viewable = None ,
4147 )
4248
4349 database .session .add (data_entry )
You can’t perform that action at this time.
0 commit comments