-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
35 lines (25 loc) · 1.08 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from sqlalchemy.sql.expression import null
from database import Base
from sqlalchemy import Text,JSON,text,func
from typing import Dict
from sqlalchemy.orm import Mapped,mapped_column
class Dataset(Base):
__tablename__ = 'datasets'
id:Mapped[str]=mapped_column(Text,primary_key=True)
datasets_id:Mapped[str]=mapped_column(Text)
type:Mapped[str]=mapped_column(Text,nullable=False)
name :Mapped[str]=mapped_column(Text)
validation_config:Mapped[Dict]=mapped_column(JSON)
extraction_config:Mapped[Dict]=mapped_column(JSON)
dedup_config:Mapped[Dict]=mapped_column(JSON)
data_schema:Mapped[Dict]=mapped_column(JSON)
denorm_config:Mapped[Dict]=mapped_column(JSON)
router_config:Mapped[Dict]=mapped_column(JSON)
dataset_config:Mapped[Dict]=mapped_column(JSON)
status:Mapped[str]=mapped_column(Text)
tags:Mapped[str]=mapped_column(Text)
data_version:Mapped[str]
created_by:Mapped[str]=mapped_column(Text)
updated_by:Mapped[str]=mapped_column(Text)
def __repr__(self):
return f"<Dataset name={self.name} id={self.id}>"