Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
albertobruin committed Dec 11, 2024
1 parent be0e3d0 commit bcd097c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
25 changes: 16 additions & 9 deletions cmd/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,26 @@ var (
},
}

task1 = &pipeline.Asset{Name: "Task1",
task1 = &pipeline.Asset{
Name: "Task1",
Type: pipeline.AssetTypePython,
Tags: []string{"tag1", "x"},
}

task2 = &pipeline.Asset{Name: "Task2",
task2 = &pipeline.Asset{
Name: "Task2",
Type: pipeline.AssetTypeBigqueryQuery,
Tags: []string{"tag2"},
}

task3 = &pipeline.Asset{Name: "Task3", Type: pipeline.AssetTypePython,
task3 = &pipeline.Asset{
Name: "Task3", Type: pipeline.AssetTypePython,
Tags: []string{"tag4"},
Upstreams: []pipeline.Upstream{{Type: "asset", Value: "Task9"}},
}

task4 = &pipeline.Asset{Name: "Task4",
task4 = &pipeline.Asset{
Name: "Task4",
Type: pipeline.AssetTypeBigqueryQuery,
Tags: []string{"tag1", "tag3"},
Upstreams: []pipeline.Upstream{{Type: "asset", Value: "Task9"}},
Expand Down Expand Up @@ -493,8 +497,10 @@ func TestApplyFilters(t *testing.T) {
IncludeDownstream: true,
IncludeTag: "tag1",
},
expectedPending: []string{"Task0", "Task1", "Task4", "Task5", "Task6", "Task7", "Task8",
"Task0:Column0:Check0", "Task0:custom-check:customcheck0"}, // task 2 and 3 shouldnt run
expectedPending: []string{
"Task0", "Task1", "Task4", "Task5", "Task6", "Task7", "Task8",
"Task0:Column0:Check0", "Task0:custom-check:customcheck0",
}, // task 2 and 3 shouldnt run
expectError: false,
},
{
Expand Down Expand Up @@ -654,16 +660,17 @@ func TestApplyFilters(t *testing.T) {
},
},
filter: &Filter{},
expectedPending: []string{"Task0", "Task1", "Task2", "Task3", "Task4", "Task5", "Task6", "Task7", "Task8", "Task9", "Task10",
"Task10:Column10:Check10", "Task10:custom-check:customcheck10", "Task0:Column0:Check0", "Task0:custom-check:customcheck0"},
expectedPending: []string{
"Task0", "Task1", "Task2", "Task3", "Task4", "Task5", "Task6", "Task7", "Task8", "Task9", "Task10",
"Task10:Column10:Check10", "Task10:custom-check:customcheck10", "Task0:Column0:Check0", "Task0:custom-check:customcheck0",
},
expectError: false,
},
{
name: " Run single asset with only Checks",
pipeline: &pipeline.Pipeline{
Name: "TestPipeline",
Assets: []*pipeline.Asset{

task6,
task7,
task8,
Expand Down
4 changes: 3 additions & 1 deletion pythonsrc/parser/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,6 @@ def find_leaf_nodes(node: Node, leaf_nodes):


def merge_parts(table: exp.Table) -> str:
return ".".join(part.name for part in table.parts if isinstance(part, exp.Identifier))
return ".".join(
part.name for part in table.parts if isinstance(part, exp.Identifier)
)

0 comments on commit bcd097c

Please sign in to comment.