Skip to content

Commit e48fa25

Browse files
committed
refactor(tests): streamline print statements for query results
- Simplified print statements in `test_model_code_change.py` and `test_models.py` by removing unnecessary line breaks and parentheses. - Enhanced readability of SQL query outputs while maintaining original functionality. - Improved consistency in formatting across test functions.
1 parent c30776c commit e48fa25

File tree

2 files changed

+6
-48
lines changed

2 files changed

+6
-48
lines changed

dagster_sqlmesh/controller/tests_plan_and_run/test_model_code_change.py

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,10 @@ def test_given_model_chain_when_running_with_different_flags_then_behaves_as_exp
6060
)
6161

6262
print(
63-
f"intermediate_model_1 first run: {
64-
(
65-
sample_sqlmesh_test_context.query(
66-
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
67-
return_df=True,
68-
)
69-
)
70-
}"
63+
f"intermediate_model_1 first run: {sample_sqlmesh_test_context.query('SELECT * FROM sqlmesh_example__dev.intermediate_model_1', return_df=True)}"
7164
)
7265
print(
73-
f"full_model first run: {
74-
(
75-
sample_sqlmesh_test_context.query(
76-
'SELECT * FROM sqlmesh_example__dev.full_model',
77-
return_df=True,
78-
)
79-
)
80-
}"
66+
f"full_model first run: {sample_sqlmesh_test_context.query('SELECT * FROM sqlmesh_example__dev.full_model', return_df=True)}"
8167
)
8268

8369
# Store initial timestamp before making changes
@@ -132,25 +118,10 @@ def test_given_model_chain_when_running_with_different_flags_then_behaves_as_exp
132118
)
133119

134120
print(
135-
f"intermediate_model_1 after first model change to upstream model: {
136-
(
137-
sample_sqlmesh_test_context.query(
138-
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
139-
return_df=True,
140-
)
141-
)
142-
}"
121+
f"intermediate_model_1 after first model change to upstream model: {sample_sqlmesh_test_context.query('SELECT * FROM sqlmesh_example__dev.intermediate_model_1', return_df=True)}"
143122
)
144-
145123
print(
146-
f"full_model after first model change to upstream model: {
147-
(
148-
sample_sqlmesh_test_context.query(
149-
'SELECT * FROM sqlmesh_example__dev.full_model',
150-
return_df=True,
151-
)
152-
)
153-
}"
124+
f"full_model after first model change to upstream model: {sample_sqlmesh_test_context.query('SELECT * FROM sqlmesh_example__dev.full_model', return_df=True)}"
154125
)
155126

156127
full_model_df = (

dagster_sqlmesh/controller/tests_plan_and_run/test_models.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,10 @@ def test_given_model_chain_when_running_with_different_flags_then_behaves_as_exp
154154
}
155155
print(f"final_counts: {final_counts}")
156156
print(
157-
f"intermediate_model_1: {
158-
(
159-
sample_sqlmesh_test_context.query(
160-
'SELECT * FROM sqlmesh_example__dev.intermediate_model_1',
161-
return_df=True,
162-
)
163-
)
164-
}"
157+
f"intermediate_model_1: {sample_sqlmesh_test_context.query('SELECT * FROM sqlmesh_example__dev.intermediate_model_1', return_df=True)}"
165158
)
166159
print(
167-
f"full_model: {
168-
(
169-
sample_sqlmesh_test_context.query(
170-
'SELECT * FROM sqlmesh_example__dev.full_model', return_df=True
171-
)
172-
)
173-
}"
160+
f"full_model: {sample_sqlmesh_test_context.query('SELECT * FROM sqlmesh_example__dev.full_model', return_df=True)}"
174161
)
175162

176163
# Verify counts match expectations

0 commit comments

Comments
 (0)