Safe Haskell | None |
---|---|
Language | GHC2024 |
Synopsis
- type TableName = SpecTableName
- newtype YAMLTask = YAMLTask {
- unYAMLTask :: Text
- data Artifact
- getArtifact :: Artifact -> TableName
- getArtifactName :: Artifact -> Text
- data TableTaskType
- = Entry [TaskId]
- | PreHook Int
- | CreateAction [UpdateStrategy]
- | PostHook Int
- | Exit
- data TaskType
- data Label
- type ForcedTaskIdMap = Map TaskId ForceTable
- isForcedSkipped :: ExecutionReason -> Bool
- data Task payload = Task {
- taskId :: TaskId
- payload :: payload
- labels :: Set Label
- dependencies :: Set TaskId
- subgraphEntryId :: TaskId
- subgraphExitId :: TaskId
- shouldRun :: Bool
- executionReason :: ExecutionReason
- taskType :: TaskType
- prettyTaskName :: (SpecTableName -> Ref Table) -> Task (Executable b) -> Text
- newtype TasksDAG (kind :: k) b = TasksDAG {
- nodes :: Map TaskId (Task (Executable b))
- data Exec
- data Table
- data Full
- data Executable b
- isExecutable :: Executable b -> Bool
- isOkHookResult :: forall {k} (bk :: k). HookResult bk -> Bool
- isOkTaskResult :: forall {k} (bk :: k). TaskResult bk -> Bool
- getTaskStateMemos :: forall {k} (bk :: k). TaskState bk -> Maybe TableMemo
- getTaskResultStats :: forall {k} (bk :: k). HasBackendQueryStats bk => TaskResult bk -> QueryStats bk
- getAssertions :: forall {k} (bk :: k). HasBackendQueryStats bk => TaskResult bk -> Maybe (NonEmpty AssertionEntry)
- type TaskResultWithExc (bk :: k) = Either SomeException ()
- type TasksDAGGraph (kind :: k) b = Gr (Task (Executable b)) ()
- tasksToGraph :: forall {k} (kind :: k) b. TasksDAG kind b -> TasksDAGGraph kind b
- tableDownstream :: forall {k} (kind :: k) b. TasksDAGGraph kind b -> Set TaskId -> [Task (Executable b)]
- tableUpstream :: forall {k} (kind :: k) b. TasksDAGGraph kind b -> Set TaskId -> [Task (Executable b)]
- upstreamMap :: forall {k} (kind :: k) b. TasksDAG kind b -> Map TaskId (Set TaskId)
- downstreamMap :: forall {k} (kind :: k) b. TasksDAG kind b -> Map TaskId (Set TaskId, Set TaskId)
- topsort :: forall {k} (kind :: k) b. TasksDAG kind b -> [Task (Executable b)]
- subgraph :: TasksDAG Full b -> TaskId -> Maybe (Task (Executable b) -> Bool) -> [TaskId]
- yamlTask :: Task (Executable b) -> Maybe YAMLTask
- tags :: Task (Executable b) -> [Text]
- unmanaged :: Task (Executable b) -> Maybe TableName
- createAction :: Task (Executable b) -> Maybe (TableName, [UpdateStrategy])
- tableNode :: Task (Executable b) -> Maybe TableName
- preHookNode :: Task (Executable b) -> Maybe Int
- postHookNode :: Task (Executable b) -> Maybe Int
- globalHookNode :: Task (Executable b) -> Maybe Text
- isGlobalHookNode :: Task (Executable b) -> Bool
- hookNode :: Task (Executable b) -> Bool
- tableTask :: Task (Executable b) -> Maybe TableName
- tableTaskType :: Task (Executable b) -> Maybe TableTaskType
- isEntryNode :: Task (Executable b) -> Bool
- entryNode :: Task (Executable b) -> Maybe [TaskId]
- isExitNode :: Task (Executable b) -> Bool
- tableTaskTypeDescription :: TableTaskType -> Text
- taskTypeDescription :: TaskType -> Text
- dryRunResult :: Task (Executable b) -> Maybe (Either (DryRunResult b) (ProgramDependenciesAndQueries b))
- getDependenciesWithProp :: forall {k1} b (k2 :: k1). (Task (Executable b) -> Bool) -> TasksDAG k2 b -> Task (Executable b) -> Set TaskId
- getDataDependenciesUnmanaged :: forall {k1} (k2 :: k1) b. TasksDAG k2 b -> Task (Executable b) -> Set TaskId
- tablesGraphWithGlobalHooks :: forall {k} (a :: k) b. TasksDAG a b -> TasksDAG Table b
- tablesGraph' :: TasksDAG Full b -> TasksDAG Table b
- cleanupGraph :: TasksDAG Full b -> TasksDAG Exec b
- cleanupGraphProp :: forall {k1} b (k2 :: k1). (Task (Executable b) -> Bool) -> TasksDAG k2 b -> TasksDAG k2 b
- unmanagedTables :: TasksDAG Full b -> Set SpecTableName
- managedTables :: TasksDAG Full b -> Set SpecTableName
- tablesForUpdate :: TasksDAG Full b -> Set SpecTableName
- tasksForUpdate :: TasksDAG Full b -> [Task (Executable b)]
- noUpdatedDepsFromTablesForUpdate :: TasksDAG Full b -> Set SpecTableName
- connectAsyncHooks :: forall {k} (t :: k) b. TasksDAG t b -> TasksDAG t b
Documentation
type TableName = SpecTableName #
Instances
getArtifact :: Artifact -> TableName #
getArtifactName :: Artifact -> Text #
data TableTaskType #
Entry [TaskId] | subgraph tasks Ids |
PreHook Int | |
CreateAction [UpdateStrategy] | |
PostHook Int | |
Exit |
Instances
Generic TableTaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph
from :: TableTaskType -> Rep TableTaskType x # to :: Rep TableTaskType x -> TableTaskType # | |||||
Show TableTaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph showsPrec :: Int -> TableTaskType -> ShowS # show :: TableTaskType -> String # showList :: [TableTaskType] -> ShowS # | |||||
Eq TableTaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph (==) :: TableTaskType -> TableTaskType -> Bool # (/=) :: TableTaskType -> TableTaskType -> Bool # | |||||
Ord TableTaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph compare :: TableTaskType -> TableTaskType -> Ordering # (<) :: TableTaskType -> TableTaskType -> Bool # (<=) :: TableTaskType -> TableTaskType -> Bool # (>) :: TableTaskType -> TableTaskType -> Bool # (>=) :: TableTaskType -> TableTaskType -> Bool # max :: TableTaskType -> TableTaskType -> TableTaskType # min :: TableTaskType -> TableTaskType -> TableTaskType # | |||||
type Rep TableTaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph type Rep TableTaskType = D1 ('MetaData "TableTaskType" "Napkin.Spec.Graph.TasksDAGGraph" "napkin-runtime-2.0.0-Ct8w2lsjRa3AUoSevHfCKx" 'False) ((C1 ('MetaCons "Entry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TaskId])) :+: C1 ('MetaCons "PreHook" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "CreateAction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UpdateStrategy])) :+: (C1 ('MetaCons "PostHook" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "Exit" 'PrefixI 'False) (U1 :: Type -> Type)))) |
Instances
Generic TaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph
| |||||
Eq TaskType # | |||||
Ord TaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph | |||||
type Rep TaskType # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph type Rep TaskType = D1 ('MetaData "TaskType" "Napkin.Spec.Graph.TasksDAGGraph" "napkin-runtime-2.0.0-Ct8w2lsjRa3AUoSevHfCKx" 'False) (C1 ('MetaCons "Unmanaged" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TableName)) :+: (C1 ('MetaCons "TableTask" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TableName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TableTaskType)) :+: C1 ('MetaCons "GlobalHook" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) |
Instances
Generic Label # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph
| |||||
Show Label # | |||||
Eq Label # | |||||
Ord Label # | |||||
type Rep Label # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph type Rep Label = D1 ('MetaData "Label" "Napkin.Spec.Graph.TasksDAGGraph" "napkin-runtime-2.0.0-Ct8w2lsjRa3AUoSevHfCKx" 'False) ((C1 ('MetaCons "Input" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Artifact)) :+: C1 ('MetaCons "Output" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Artifact))) :+: (C1 ('MetaCons "Tag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "YAMLTaskLabel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 YAMLTask)))) |
type ForcedTaskIdMap = Map TaskId ForceTable #
isForcedSkipped :: ExecutionReason -> Bool #
Task | |
|
Instances
Generic (Task payload) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph
| |||||
type Rep (Task payload) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph type Rep (Task payload) = D1 ('MetaData "Task" "Napkin.Spec.Graph.TasksDAGGraph" "napkin-runtime-2.0.0-Ct8w2lsjRa3AUoSevHfCKx" 'False) (C1 ('MetaCons "Task" 'PrefixI 'True) (((S1 ('MetaSel ('Just "taskId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TaskId) :*: S1 ('MetaSel ('Just "payload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 payload)) :*: (S1 ('MetaSel ('Just "labels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set Label)) :*: S1 ('MetaSel ('Just "dependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set TaskId)))) :*: ((S1 ('MetaSel ('Just "subgraphEntryId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TaskId) :*: S1 ('MetaSel ('Just "subgraphExitId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TaskId)) :*: (S1 ('MetaSel ('Just "shouldRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "executionReason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExecutionReason) :*: S1 ('MetaSel ('Just "taskType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TaskType)))))) |
prettyTaskName :: (SpecTableName -> Ref Table) -> Task (Executable b) -> Text #
newtype TasksDAG (kind :: k) b #
Instances
Default (TasksDAG kind b) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph | |||||
Generic (TasksDAG kind b) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph
| |||||
type Rep (TasksDAG kind b) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph type Rep (TasksDAG kind b) = D1 ('MetaData "TasksDAG" "Napkin.Spec.Graph.TasksDAGGraph" "napkin-runtime-2.0.0-Ct8w2lsjRa3AUoSevHfCKx" 'True) (C1 ('MetaCons "TasksDAG" 'PrefixI 'True) (S1 ('MetaSel ('Just "nodes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map TaskId (Task (Executable b)))))) |
data Executable b #
isExecutable :: Executable b -> Bool #
isOkHookResult :: forall {k} (bk :: k). HookResult bk -> Bool #
isOkTaskResult :: forall {k} (bk :: k). TaskResult bk -> Bool #
getTaskStateMemos :: forall {k} (bk :: k). TaskState bk -> Maybe TableMemo #
getTaskResultStats :: forall {k} (bk :: k). HasBackendQueryStats bk => TaskResult bk -> QueryStats bk #
getAssertions :: forall {k} (bk :: k). HasBackendQueryStats bk => TaskResult bk -> Maybe (NonEmpty AssertionEntry) #
type TaskResultWithExc (bk :: k) = Either SomeException () #
type TasksDAGGraph (kind :: k) b = Gr (Task (Executable b)) () #
tasksToGraph :: forall {k} (kind :: k) b. TasksDAG kind b -> TasksDAGGraph kind b #
tableDownstream :: forall {k} (kind :: k) b. TasksDAGGraph kind b -> Set TaskId -> [Task (Executable b)] #
tableUpstream :: forall {k} (kind :: k) b. TasksDAGGraph kind b -> Set TaskId -> [Task (Executable b)] #
topsort :: forall {k} (kind :: k) b. TasksDAG kind b -> [Task (Executable b)] #
topological graph nodes sort
subgraph :: TasksDAG Full b -> TaskId -> Maybe (Task (Executable b) -> Bool) -> [TaskId] #
transverse Entry node lists of tasks ids checking given property
tags :: Task (Executable b) -> [Text] #
createAction :: Task (Executable b) -> Maybe (TableName, [UpdateStrategy]) #
preHookNode :: Task (Executable b) -> Maybe Int #
postHookNode :: Task (Executable b) -> Maybe Int #
globalHookNode :: Task (Executable b) -> Maybe Text #
isGlobalHookNode :: Task (Executable b) -> Bool #
hookNode :: Task (Executable b) -> Bool #
tableTaskType :: Task (Executable b) -> Maybe TableTaskType #
isEntryNode :: Task (Executable b) -> Bool #
isExitNode :: Task (Executable b) -> Bool #
taskTypeDescription :: TaskType -> Text #
Node type description: Action, Pre Hook, Post Hook, Global Hook, Unmanaged
dryRunResult :: Task (Executable b) -> Maybe (Either (DryRunResult b) (ProgramDependenciesAndQueries b)) #
getDependenciesWithProp :: forall {k1} b (k2 :: k1). (Task (Executable b) -> Bool) -> TasksDAG k2 b -> Task (Executable b) -> Set TaskId #
transverse DAG upstream collecting first node's occurrences satisfying the given property
getDataDependenciesUnmanaged :: forall {k1} (k2 :: k1) b. TasksDAG k2 b -> Task (Executable b) -> Set TaskId #
tablesGraphWithGlobalHooks :: forall {k} (a :: k) b. TasksDAG a b -> TasksDAG Table b #
just table tasks nodes graph, data dependencies and global hooks
cleanupGraph :: TasksDAG Full b -> TasksDAG Exec b #
clean up no runnable nodes, remove NullProgram or not #shouldRun nodes, modifying accordingly edges (optional step)
cleanupGraphProp :: forall {k1} b (k2 :: k1). (Task (Executable b) -> Bool) -> TasksDAG k2 b -> TasksDAG k2 b #
unmanagedTables :: TasksDAG Full b -> Set SpecTableName #
managedTables :: TasksDAG Full b -> Set SpecTableName #
tablesForUpdate :: TasksDAG Full b -> Set SpecTableName #
tasksForUpdate :: TasksDAG Full b -> [Task (Executable b)] #
connectAsyncHooks :: forall {k} (t :: k) b. TasksDAG t b -> TasksDAG t b #
Connect async hooks to subgraph's exit node, used to fix async tasks with upstream table selectors