File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -500,6 +500,7 @@ def _parse_table_parts(
500500 self ._curr
501501 and self ._prev .token_type in (TokenType .L_PAREN , TokenType .R_PAREN )
502502 and self ._curr .text .upper () not in ("FILE_FORMAT" , "PATTERN" )
503+ and not (table .args .get ("format" ) or table .args .get ("pattern" ))
503504 )
504505 ):
505506 self ._retreat (index )
Original file line number Diff line number Diff line change @@ -7463,6 +7463,23 @@ def test_staged_file_path():
74637463 query = model .render_query ()
74647464 assert query .sql (dialect = "snowflake" ) == "SELECT * FROM @a.b/c/d.csv (FILE_FORMAT => 'b.ff')"
74657465
7466+ expressions = d .parse (
7467+ """
7468+ MODEL (name test, dialect snowflake);
7469+
7470+ SELECT
7471+ *
7472+ FROM @variable (FILE_FORMAT => 'foo'), @non_variable (FILE_FORMAT => 'bar')
7473+ LIMIT 100
7474+ """
7475+ )
7476+ model = load_sql_based_model (expressions , variables = {"variable" : "some_path" })
7477+ query = model .render_query ()
7478+ assert (
7479+ query .sql (dialect = "snowflake" )
7480+ == """SELECT * FROM 'some_path' (FILE_FORMAT => 'foo') AS "SOME_PATH", @non_variable (FILE_FORMAT => 'bar') LIMIT 100"""
7481+ )
7482+
74667483
74677484def test_cache ():
74687485 expressions = d .parse (
You can’t perform that action at this time.
0 commit comments