From 319fdee665ed630d508eb6aee5a33ee8c2142250 Mon Sep 17 00:00:00 2001 From: Adrian Macias <56698+iadrich@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:11:32 +0000 Subject: [PATCH 1/3] Prepare release 0.6.12 --- CHANGELOG.md | 11 +++++++++++ pyproject.toml | 2 +- sayn/__init__.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d87405df..406ffd64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## [0.6.12] - 2024-01-19 + +### Changed + +- Snowflake: temporary objects are created as `temp` where possible + (ie: stages, incremental tables,...) +- Added flag to run command (--with-tests) that combines the execution of + both tests and tasks +- Added new flag to run and test commands (--fail-fast) that terminates the + execution upon an error on any task or test + ## [0.6.11] - 2023-08-30 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index 6ca61075..5a3426fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "sayn" -version = "0.6.11" +version = "0.6.12" description = "Data-modelling and processing framework for automating Python and SQL tasks" authors = ["Sotiris Gkoulimaris ", "Adrian Macias "] license = "Apache-2.0" diff --git a/sayn/__init__.py b/sayn/__init__.py index 5bb0d299..f5f63b20 100644 --- a/sayn/__init__.py +++ b/sayn/__init__.py @@ -5,7 +5,7 @@ # except: # pass -__version__ = "0.6.11" +__version__ = "0.6.12" from .tasks.python import PythonTask, task From d17f53e8148f741ca4e59382e383735de1dad494 Mon Sep 17 00:00:00 2001 From: Adrian Macias <56698+iadrich@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:03:35 +0000 Subject: [PATCH 2/3] Fix compile with tests --- sayn/tasks/sql.py | 2 ++ sayn/tasks/task_wrapper.py | 2 -- sayn/tasks/test.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sayn/tasks/sql.py b/sayn/tasks/sql.py index ec41ccaa..c836af84 100644 --- a/sayn/tasks/sql.py +++ b/sayn/tasks/sql.py @@ -441,6 +441,8 @@ def execute(self, execute, debug): return Ok() def compile(self): + if self.run_arguments["with_tests"] and self._has_tests: + self.write_compilation_output(self.test_query, "test") return self.execute(False, self.run_arguments["debug"]) def run(self): diff --git a/sayn/tasks/task_wrapper.py b/sayn/tasks/task_wrapper.py index 8639dbb6..1a22b58f 100644 --- a/sayn/tasks/task_wrapper.py +++ b/sayn/tasks/task_wrapper.py @@ -386,8 +386,6 @@ def execute_task(self, command): result = self.runner.test() elif command == "compile": result = self.runner.compile() - if self.run_arguments["with_tests"] and self.has_tests(): - result = self.runner.test() else: result = self.runner.test() diff --git a/sayn/tasks/test.py b/sayn/tasks/test.py index ace1445f..e7e6c731 100644 --- a/sayn/tasks/test.py +++ b/sayn/tasks/test.py @@ -133,6 +133,10 @@ def config_macro(self, **config): # Returns an empty string to avoid productin incorrect sql return "" + def compile(self): + with self.step("Write Test Query"): + self.write_compilation_output(self.test_query, "test") + def setup(self): if self.needs_recompile: self.test_query = self.compiler.compile(self.task_config.file_name) From c48028d9f704a50df300aeadd00a9c4b33c309bf Mon Sep 17 00:00:00 2001 From: Adrian Macias <56698+iadrich@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:11:58 +0000 Subject: [PATCH 3/3] Fix formatting --- sayn/tasks/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sayn/tasks/test.py b/sayn/tasks/test.py index e7e6c731..97da3adc 100644 --- a/sayn/tasks/test.py +++ b/sayn/tasks/test.py @@ -135,7 +135,7 @@ def config_macro(self, **config): def compile(self): with self.step("Write Test Query"): - self.write_compilation_output(self.test_query, "test") + self.write_compilation_output(self.test_query, "test") def setup(self): if self.needs_recompile: