Skip to content

Commit 974013a

Browse files
Gabe PescoGabe Pesco
authored andcommitted
Chore: fix style CI failures
- Simplify known_models type annotation (UniqueKeyDict extends Dict, union was redundant) - Reformat test list comprehension and assert to satisfy ruff line-length check
1 parent ab82fb0 commit 974013a

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

sqlmesh/core/schema_loader.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ def create_external_models_file(
4141
classified as external if it is absent from this full set. This prevents cross-repo
4242
internal models from being misclassified as external in multi-repo setups.
4343
"""
44-
known_models: t.Union[UniqueKeyDict[str, Model], t.Dict[str, Model]] = (
45-
all_models if all_models is not None else models
46-
)
44+
known_models: t.Dict[str, Model] = all_models if all_models is not None else models
4745
external_model_fqns = set()
4846

4947
for fqn, model in models.items():

tests/core/integration/test_multi_repo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,9 @@ def test_multi_repo_create_external_models(copy_to_temp_path):
587587

588588
warning_messages = [str(call) for call in mock_warning.call_args_list]
589589
schema_lookup_warnings = [
590-
msg for msg in warning_messages if "bronze" in msg and "a" in msg and "schema" in msg.lower()
590+
msg
591+
for msg in warning_messages
592+
if "bronze" in msg and "a" in msg and "schema" in msg.lower()
591593
]
592594
assert not schema_lookup_warnings, (
593595
"bronze.a should not be looked up as an external model, but got warnings: "
@@ -607,9 +609,7 @@ def test_multi_repo_create_external_models(copy_to_temp_path):
607609
repo_1_external = Path(repo_1_path) / c.EXTERNAL_MODELS_YAML
608610
if repo_1_external.exists():
609611
contents = yaml.load(repo_1_external)
610-
assert len(contents) == 0, (
611-
f"repo_1 should have no external models, got: {contents}"
612-
)
612+
assert len(contents) == 0, f"repo_1 should have no external models, got: {contents}"
613613

614614
# Plan should still resolve all 5 models as internal after create_external_models
615615
context.load()

0 commit comments

Comments
 (0)