Skip to content

Commit 9f91161

Browse files
committed
[DOP-31721] Validate SQL transformation FROM clause
1 parent 9f89355 commit 9f91161

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

tests/test_unit/test_transfers/test_create_transfer.py

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -875,39 +875,6 @@ async def test_superuser_can_create_transfer(
875875
},
876876
id="sql_invalid_select_query",
877877
),
878-
pytest.param(
879-
{
880-
"transformations": [
881-
{
882-
"type": "sql",
883-
"query": None,
884-
"dialect": "spark",
885-
},
886-
],
887-
},
888-
{
889-
"error": {
890-
"code": "invalid_request",
891-
"message": "Invalid request",
892-
"details": [
893-
{
894-
"location": [
895-
"body",
896-
"transformations",
897-
0,
898-
"sql",
899-
"query",
900-
],
901-
"message": "Input should be a valid string",
902-
"code": "string_type",
903-
"context": {},
904-
"input": None,
905-
},
906-
],
907-
},
908-
},
909-
id="sql_non_string_query",
910-
),
911878
pytest.param(
912879
{
913880
"resources": {
@@ -1415,7 +1382,7 @@ async def test_developer_plus_can_create_transfer_with_sql_transformation(
14151382
"transformations": [
14161383
{
14171384
"type": "sql",
1418-
"query": "SELECT * FROM table",
1385+
"query": "SELECT * FROM source",
14191386
"dialect": "spark",
14201387
},
14211388
],
@@ -1454,10 +1421,10 @@ async def test_developer_plus_can_create_transfer_with_sql_transformation(
14541421
@pytest.mark.parametrize(
14551422
"query",
14561423
[
1457-
"SELECT col1, col2 FROM table1 WHERE col1 > 100;",
1424+
"SELECT col1, col2 FROM source WHERE col1 > 100;",
14581425
"select col1 from table1",
1459-
" SELECT col1 FROM table1 ",
1460-
" WITH some AS (SELECT col1 FROM table1) SELECT * FROM some;",
1426+
" SELECT col1 FROM source ",
1427+
" WITH some AS (SELECT col1 FROM source) SELECT * FROM some;",
14611428
],
14621429
)
14631430
async def test_sql_transformation_with_valid_select_queries(

0 commit comments

Comments
 (0)