Skip to content

Commit c30776c

Browse files
committed
refactor(tests): improve query formatting for clarity in test cases
- Updated SQL query formatting in `test_model_code_change.py` and `test_models.py` to enhance readability. - Wrapped query calls in parentheses for better visual structure and consistency across test functions. - Ensured that the changes maintain the original functionality while improving code clarity.
1 parent 6e2d482 commit c30776c

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

dagster_sqlmesh/controller/tests_plan_and_run/test_model_code_change.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,21 @@ def test_given_model_chain_when_running_with_different_flags_then_behaves_as_exp
6161

6262
print(
6363
f"intermediate_model_1 first run: {
64-
sample_sqlmesh_test_context.query(
65-
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
66-
return_df=True,
64+
(
65+
sample_sqlmesh_test_context.query(
66+
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
67+
return_df=True,
68+
)
6769
)
6870
}"
6971
)
7072
print(
7173
f"full_model first run: {
72-
sample_sqlmesh_test_context.query(
73-
'SELECT * FROM sqlmesh_example__dev.full_model',
74-
return_df=True,
74+
(
75+
sample_sqlmesh_test_context.query(
76+
'SELECT * FROM sqlmesh_example__dev.full_model',
77+
return_df=True,
78+
)
7579
)
7680
}"
7781
)
@@ -129,18 +133,22 @@ def test_given_model_chain_when_running_with_different_flags_then_behaves_as_exp
129133

130134
print(
131135
f"intermediate_model_1 after first model change to upstream model: {
132-
sample_sqlmesh_test_context.query(
133-
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
134-
return_df=True,
136+
(
137+
sample_sqlmesh_test_context.query(
138+
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
139+
return_df=True,
140+
)
135141
)
136142
}"
137143
)
138144

139145
print(
140146
f"full_model after first model change to upstream model: {
141-
sample_sqlmesh_test_context.query(
142-
'SELECT * FROM sqlmesh_example__dev.full_model',
143-
return_df=True,
147+
(
148+
sample_sqlmesh_test_context.query(
149+
'SELECT * FROM sqlmesh_example__dev.full_model',
150+
return_df=True,
151+
)
144152
)
145153
}"
146154
)

dagster_sqlmesh/controller/tests_plan_and_run/test_models.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,20 @@ def test_given_model_chain_when_running_with_different_flags_then_behaves_as_exp
155155
print(f"final_counts: {final_counts}")
156156
print(
157157
f"intermediate_model_1: {
158-
sample_sqlmesh_test_context.query(
159-
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
160-
return_df=True,
158+
(
159+
sample_sqlmesh_test_context.query(
160+
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
161+
return_df=True,
162+
)
161163
)
162164
}"
163165
)
164166
print(
165167
f"full_model: {
166-
sample_sqlmesh_test_context.query(
167-
'SELECT * FROM sqlmesh_example__dev.full_model', return_df=True
168+
(
169+
sample_sqlmesh_test_context.query(
170+
'SELECT * FROM sqlmesh_example__dev.full_model', return_df=True
171+
)
168172
)
169173
}"
170174
)

0 commit comments

Comments
 (0)