File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
functions-python/dataset_service Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ from dataclasses import dataclass
2+ from datetime import datetime
3+ from enum import Enum
4+ from typing import Optional
5+
6+
7+ # Status of the dataset trace
8+ class Status (Enum ):
9+ FAILED = "FAILED"
10+ SUCCESS = "SUCCESS"
11+ PUBLISHED = "PUBLISHED"
12+ NOT_PUBLISHED = "NOT_PUBLISHED"
13+ PROCESSING = "PROCESSING"
14+
15+
16+ # Stage of the pipeline
17+ class PipelineStage (Enum ):
18+ DATASET_PROCESSING = "DATASET_PROCESSING"
19+ LOCATION_EXTRACTION = "LOCATION_EXTRACTION"
20+ GBFS_VALIDATION = "GBFS_VALIDATION"
21+
22+
23+ # Dataset trace class to store the trace of a dataset
24+ @dataclass
25+ class DatasetTrace :
26+ stable_id : str
27+ status : Status
28+ timestamp : datetime
29+ dataset_id : Optional [str ] = None
30+ trace_id : Optional [str ] = None
31+ execution_id : Optional [str ] = None
32+ file_sha256_hash : Optional [str ] = None
33+ hosted_url : Optional [str ] = None
34+ pipeline_stage : PipelineStage = PipelineStage .DATASET_PROCESSING
35+ error_message : Optional [str ] = None
36+
37+
38+ # Batch execution class to store the trace of a batch execution
39+ @dataclass
40+ class BatchExecution :
41+ execution_id : str
42+ timestamp : datetime
43+ feeds_total : int
You can’t perform that action at this time.
0 commit comments