Skip to content

Commit 241e6ce

Browse files
committed
fix broken tests
1 parent 8b97bb8 commit 241e6ce

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/databricks/sqlalchemy/test_local/test_parsing.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,26 @@ def test_extract_3l_namespace_from_constraint_string():
5858

5959

6060
def test_extract_3l_namespace_from_bad_constraint_string():
61-
input = "FOREIGN KEY (`parent_user_id`) REFERENCES `pysql_dialect_compliance`.`users` (`user_id`)"
61+
input = (
62+
"FOREIGN KEY (`parent_user_id`) REFERENCES `pysql_dialect_compliance`.`users` (`user_id`)"
63+
)
6264

6365
with pytest.raises(DatabricksSqlAlchemyParseException):
6466
extract_three_level_identifier_from_constraint_string(input)
6567

6668

67-
@pytest.mark.parametrize("schema", [None, "some_schema"])
68-
def test_build_fk_dict(schema):
69-
fk_constraint_string = "FOREIGN KEY (`parent_user_id`) REFERENCES `main`.`some_schema`.`users` (`user_id`)"
69+
@pytest.mark.parametrize("tschema", [None, "some_schema"])
70+
def test_build_fk_dict(tschema):
71+
fk_constraint_string = (
72+
"FOREIGN KEY (`parent_user_id`) REFERENCES `main`.`some_schema`.`users` (`user_id`)"
73+
)
7074

71-
result = build_fk_dict("some_fk_name", fk_constraint_string, schema_name=schema)
75+
result = build_fk_dict("some_fk_name", fk_constraint_string, schema_name=tschema)
7276

7377
assert result == {
7478
"name": "some_fk_name",
7579
"constrained_columns": ["parent_user_id"],
76-
"referred_schema": schema,
80+
"referred_schema": tschema,
7781
"referred_table": "users",
7882
"referred_columns": ["user_id"],
7983
}
@@ -123,9 +127,7 @@ def test_build_pk_dict():
123127
],
124128
]
125129

126-
FMT_SAMPLE_DT_OUTPUT = [
127-
{"col_name": i[0], "data_type": i[1]} for i in RAW_SAMPLE_DTE_OUTPUT
128-
]
130+
FMT_SAMPLE_DT_OUTPUT = [{"col_name": i[0], "data_type": i[1]} for i in RAW_SAMPLE_DTE_OUTPUT]
129131

130132

131133
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)