diff --git a/CHANGELOG.md b/CHANGELOG.md index dc526c203..a28ea3025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * [Fix] Fixed CI issue by updating `invalid_connection_string_duckdb` in `test_magic.py` (#631) * [Fix] Refactored `ResultSet` to lazy loading (#470) * [Fix] Removed `WITH` when a snippet does not have a dependency (#657) +* [Fix] Used display module when generating CTE (#649) ## 0.7.9 (2023-06-19) diff --git a/src/sql/magic.py b/src/sql/magic.py index d74d07eba..e24fea7b5 100644 --- a/src/sql/magic.py +++ b/src/sql/magic.py @@ -367,7 +367,7 @@ def interactive_execute_wrapper(**kwargs): with_ = self._store.infer_dependencies(command.sql_original, args.save) if with_: command.set_sql_with(with_) - print(f"Generating CTE with stored snippets : {', '.join(with_)}") + display.message(f"Generating CTE with stored snippets: {', '.join(with_)}") else: with_ = None diff --git a/src/tests/test_magic_cte.py b/src/tests/test_magic_cte.py index a7b96adb6..5050fa02b 100644 --- a/src/tests/test_magic_cte.py +++ b/src/tests/test_magic_cte.py @@ -56,7 +56,7 @@ def test_infer_dependencies(ip, capsys): ) assert result == expected - assert "Generating CTE with stored snippets : author_sub" in out + assert "Generating CTE with stored snippets: author_sub" in out def test_deprecation_warning(ip): @@ -148,7 +148,7 @@ def test_snippets_delete(ip, capsys): ) out, _ = capsys.readouterr() - assert "Generating CTE with stored snippets : another_orders" in out + assert "Generating CTE with stored snippets: another_orders" in out result_del = ip.run_cell( "%sqlcmd snippets --delete-force-all another_orders" ).result