File size: 519 Bytes
cf450f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import Any

from pydantic import BaseModel, Field
from surrealdb import RecordID, Value


def IsNone(value: Any | None):  # pyright: ignore[reportExplicitAny]
    return value is None


class Flow(BaseModel):
    id: RecordID = Field(exclude=True)
    table: str
    dependencies: list[str]
    stamp: str
    priority: int
    hash: str

    @property
    def name(self) -> str:
        id = str(self.id.id) if self.id else "Unknown"
        return id if id else "Unknown"


type Record = dict[str, Value]