Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- type TableName = Ref Table
- 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
- data ForceTable
- data ExecutionReason
- 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 :: (Ref Table -> 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
- data HookResult (bk :: k)
- isOkHookResult :: forall {k} (bk :: k). HookResult bk -> Bool
- data TaskResult (bk :: k)
- = TableResult (CreateQueryStats bk)
- | HookResult (HookResult bk) (HookQueryStats bk)
- | NullResult
- isOkTaskResult :: forall {k} {bk :: k}. TaskResult bk -> Bool
- 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 (NominalDiffTime, TaskResult bk)
- type TaskResultWithExc' (bk :: k) = Either SomeException (NominalDiffTime, Maybe (TaskResult bk))
- type TaskAsync (bk :: k) = Async (NominalDiffTime, Maybe (TaskResult bk))
- 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)]
- matchGraphTables :: forall {k} (kind :: k) b. TasksDAGGraph kind b -> (Task (Executable b) -> Bool) -> [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
- actionNode :: 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 (ProgramDependenciesAndQueries b)
- getDependenciesWithProp :: forall {k1} b (k2 :: k1). (Task (Executable b) -> Bool) -> TasksDAG k2 b -> Task (Executable b) -> Set TaskId
- getDataDependencies :: forall {k1} (k2 :: k1) b. TasksDAG k2 b -> Task (Executable b) -> Set TaskId
- getDataDependenciesUnmanaged :: forall {k1} (k2 :: k1) b. TasksDAG k2 b -> Task (Executable b) -> Set TaskId
- tablesGraph :: 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
- 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
getArtifact :: Artifact -> TableName #
getArtifactName :: Artifact -> Text #
data TableTaskType #
Entry [TaskId] | subgraph tasks Ids |
PreHook Int | |
CreateAction [UpdateStrategy] | |
PostHook Int | |
Exit |
Instances
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-1.0.0-5YkWAC9Wc776PT0LDghaFb" '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-1.0.0-5YkWAC9Wc776PT0LDghaFb" '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)))) |
data ForceTable #
Instances
Show ForceTable # | |
Defined in Napkin.Spec.Graph.TasksDAGGraph showsPrec :: Int -> ForceTable -> ShowS # show :: ForceTable -> String # showList :: [ForceTable] -> ShowS # | |
Eq ForceTable # | |
Defined in Napkin.Spec.Graph.TasksDAGGraph (==) :: ForceTable -> ForceTable -> Bool # (/=) :: ForceTable -> ForceTable -> Bool # | |
Ord ForceTable # | |
Defined in Napkin.Spec.Graph.TasksDAGGraph compare :: ForceTable -> ForceTable -> Ordering # (<) :: ForceTable -> ForceTable -> Bool # (<=) :: ForceTable -> ForceTable -> Bool # (>) :: ForceTable -> ForceTable -> Bool # (>=) :: ForceTable -> ForceTable -> Bool # max :: ForceTable -> ForceTable -> ForceTable # min :: ForceTable -> ForceTable -> ForceTable # |
data ExecutionReason #
Instances
Show ExecutionReason # | |
Defined in Napkin.Spec.Graph.TasksDAGGraph showsPrec :: Int -> ExecutionReason -> ShowS # show :: ExecutionReason -> String # showList :: [ExecutionReason] -> ShowS # | |
Eq ExecutionReason # | |
Defined in Napkin.Spec.Graph.TasksDAGGraph (==) :: ExecutionReason -> ExecutionReason -> Bool # (/=) :: ExecutionReason -> ExecutionReason -> Bool # | |
Ord ExecutionReason # | |
Defined in Napkin.Spec.Graph.TasksDAGGraph compare :: ExecutionReason -> ExecutionReason -> Ordering # (<) :: ExecutionReason -> ExecutionReason -> Bool # (<=) :: ExecutionReason -> ExecutionReason -> Bool # (>) :: ExecutionReason -> ExecutionReason -> Bool # (>=) :: ExecutionReason -> ExecutionReason -> Bool # max :: ExecutionReason -> ExecutionReason -> ExecutionReason # min :: ExecutionReason -> ExecutionReason -> ExecutionReason # | |
ToClassName ExecutionReason # | |
Defined in Napkin.Cli.Web.Styles toClassName :: ExecutionReason -> Text # | |
ToColor ExecutionReason # | |
Defined in Napkin.Cli.Web.Styles colorValue :: ExecutionReason -> HexColor # colorName :: ExecutionReason -> Text # |
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-1.0.0-5YkWAC9Wc776PT0LDghaFb" '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 :: (Ref Table -> Ref Table) -> Task (Executable b) -> Text #
newtype TasksDAG (kind :: k) b #
Instances
Generic (TasksDAG kind b) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph
| |||||
Default (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-1.0.0-5YkWAC9Wc776PT0LDghaFb" '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 #
data HookResult (bk :: k) #
HookError (NonEmpty AssertionEntry) | Fatal Assertions |
HookOk [AssertionEntry] | Warning Assertions |
isOkHookResult :: forall {k} (bk :: k). HookResult bk -> Bool #
data TaskResult (bk :: k) #
TableResult (CreateQueryStats bk) | |
HookResult (HookResult bk) (HookQueryStats bk) | |
NullResult |
Instances
Generic (TaskResult bk) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph
from :: TaskResult bk -> Rep (TaskResult bk) x # to :: Rep (TaskResult bk) x -> TaskResult bk # | |||||
type Rep (TaskResult bk) # | |||||
Defined in Napkin.Spec.Graph.TasksDAGGraph type Rep (TaskResult bk) = D1 ('MetaData "TaskResult" "Napkin.Spec.Graph.TasksDAGGraph" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'False) (C1 ('MetaCons "TableResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CreateQueryStats bk))) :+: (C1 ('MetaCons "HookResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HookResult bk)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HookQueryStats bk))) :+: C1 ('MetaCons "NullResult" 'PrefixI 'False) (U1 :: Type -> Type))) |
isOkTaskResult :: forall {k} {bk :: k}. TaskResult bk -> Bool #
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 (NominalDiffTime, TaskResult bk) #
type TaskResultWithExc' (bk :: k) = Either SomeException (NominalDiffTime, Maybe (TaskResult bk)) #
type TaskAsync (bk :: k) = Async (NominalDiffTime, Maybe (TaskResult bk)) #
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)] #
matchGraphTables :: forall {k} (kind :: k) b. TasksDAGGraph kind b -> (Task (Executable b) -> Bool) -> [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 #
actionNode :: 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 (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
getDataDependencies :: forall {k1} (k2 :: k1) b. TasksDAG k2 b -> Task (Executable b) -> Set TaskId #
getDataDependenciesUnmanaged :: forall {k1} (k2 :: k1) b. TasksDAG k2 b -> Task (Executable b) -> Set TaskId #
tablesGraph :: 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 #
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