You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/07/28 13:40:58 UTC

[airflow] branch main updated: test(hooks/exasol): add test for no resultSet rtn type (#25277)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 4dc1778a64 test(hooks/exasol): add test for no resultSet rtn type (#25277)
4dc1778a64 is described below

commit 4dc1778a64f1adac212e97919248d020ed8447de
Author: Anja Istenič <67...@users.noreply.github.com>
AuthorDate: Thu Jul 28 15:40:50 2022 +0200

    test(hooks/exasol): add test for no resultSet rtn type (#25277)
---
 tests/providers/exasol/hooks/test_exasol.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/providers/exasol/hooks/test_exasol.py b/tests/providers/exasol/hooks/test_exasol.py
index bf85465629..3440693e60 100644
--- a/tests/providers/exasol/hooks/test_exasol.py
+++ b/tests/providers/exasol/hooks/test_exasol.py
@@ -137,6 +137,15 @@ class TestExasolHook(unittest.TestCase):
             self.db_hook.run(sql=[])
         assert err.value.args[0] == "List of SQL statements is empty"
 
+    def test_no_result_set(self):
+        """Queries like DROP and SELECT are of type rowCount (not resultSet),
+        which raises an error in pyexasol if trying to iterate over them"""
+        self.cur.result_type = mock.Mock()
+        self.cur.result_type.return_value = 'rowCount'
+
+        sql = 'SQL'
+        self.db_hook.run(sql)
+
     def test_bulk_load(self):
         with pytest.raises(NotImplementedError):
             self.db_hook.bulk_load('table', '/tmp/file')