level2.py 895 Bytes
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
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
36
37
38
39
40
import dataclasses
from .common import BaseModel

@dataclasses.dataclass
class Level2Record(BaseModel):
    id: int = 0
    level0_id: str = ''
    level1_id: int = 0
    brick_id: int = 0
    module_id: str = ''
    object_name : str=""
    data_type: str=""
    filename : str=""
    file_path: str=""
    qc2_status: int = 0
    qc2_time: str=""
    prc_status: int = 0
    prc_time: str=""
    create_time: str=""
    update_time: str=""
    pipeline_id: str=""
    import_status: int = 0

@dataclasses.dataclass
class Level2TypeRecord(BaseModel):
    data_type: str=""
    module_id: str = ''
    key_column : str=""
    hdu_index: int=0
    demo_filename : str=""
    demo_file_path: str=""
    ra_column: str=""
    dec_column: str=""
    update_time: str=""
    create_time: str=""
    import_status: int = 0

def filter_table_name(data_type):
    return '_'.join(data_type.split('-'))