Skip to content

Commit

Permalink
lint + install missing sqlalchemy library
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Feb 13, 2024
1 parent 5a2de00 commit 4b995e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
run: poetry install --no-interaction --no-root --all-extras
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
Expand Down
12 changes: 5 additions & 7 deletions src/databricks/sqlalchemy/test_local/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,15 @@ def test_extract_3l_namespace_from_constraint_string():


def test_extract_3l_namespace_from_bad_constraint_string():
input = (
"FOREIGN KEY (`parent_user_id`) REFERENCES `pysql_dialect_compliance`.`users` (`user_id`)"
)
input = "FOREIGN KEY (`parent_user_id`) REFERENCES `pysql_dialect_compliance`.`users` (`user_id`)"

with pytest.raises(DatabricksSqlAlchemyParseException):
extract_three_level_identifier_from_constraint_string(input)


@pytest.mark.parametrize("tschema", [None, "some_schema"])
def test_build_fk_dict(tschema):
fk_constraint_string = (
"FOREIGN KEY (`parent_user_id`) REFERENCES `main`.`some_schema`.`users` (`user_id`)"
)
fk_constraint_string = "FOREIGN KEY (`parent_user_id`) REFERENCES `main`.`some_schema`.`users` (`user_id`)"

result = build_fk_dict("some_fk_name", fk_constraint_string, schema_name=tschema)

Expand Down Expand Up @@ -127,7 +123,9 @@ def test_build_pk_dict():
],
]

FMT_SAMPLE_DT_OUTPUT = [{"col_name": i[0], "data_type": i[1]} for i in RAW_SAMPLE_DTE_OUTPUT]
FMT_SAMPLE_DT_OUTPUT = [
{"col_name": i[0], "data_type": i[1]} for i in RAW_SAMPLE_DTE_OUTPUT
]


@pytest.mark.parametrize(
Expand Down

0 comments on commit 4b995e0

Please sign in to comment.