File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -891,7 +891,7 @@ def find_tables(
891891 normalize_model_name (table , default_catalog = default_catalog , dialect = dialect )
892892 for scope in traverse_scope (expression )
893893 for table in scope .tables
894- if table .name not in scope .cte_sources
894+ if table .name and table . name not in scope .cte_sources
895895 }
896896 return expression .meta [TABLES_META ]
897897
Original file line number Diff line number Diff line change @@ -496,3 +496,29 @@ def test_test_generation(tmp_path: Path) -> None:
496496 test = load_yaml (context .path / c .TESTS / "foo/bar.yaml" )
497497 assert len (test ) == 1
498498 assert "new_name" in test
499+
500+
501+ def test_source_func () -> None :
502+ result = _create_test (
503+ body = load_yaml (
504+ """
505+ test_foo:
506+ model: xyz
507+ outputs:
508+ query:
509+ - month: 2023-01-01
510+ - month: 2023-02-01
511+ - month: 2023-03-01
512+ """
513+ ),
514+ test_name = "test_foo" ,
515+ model = _create_model (
516+ """
517+ SELECT range::DATE AS month
518+ FROM RANGE(DATE '2023-01-01', DATE '2023-04-01', INTERVAL 1 MONTH) AS r
519+ """
520+ ),
521+ context = Context (config = Config (model_defaults = ModelDefaultsConfig (dialect = "duckdb" ))),
522+ ).run ()
523+
524+ assert result and result .wasSuccessful ()
You can’t perform that action at this time.
0 commit comments