Changeset: ba521030274d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ba521030274d
Added Files:
        testing/explain.py
Removed Files:
        monetdb5/extras/mal_optimizer_template/Tests/explain.py
        sql/test/BugTracker-2010/Tests/explain.py
Modified Files:
        testing/CMakeLists.txt
        testing/sqllogictest.py
Branch: mtest
Log Message:

Move explain filters to testing directory and place them on MonetDBtesting 
module


diffs (59 lines):

diff --git a/sql/test/BugTracker-2010/Tests/explain.py 
b/sql/test/BugTracker-2010/Tests/explain.py
deleted file mode 100644
--- a/sql/test/BugTracker-2010/Tests/explain.py
+++ /dev/null
@@ -1,28 +0,0 @@
-
-import re
-
-def filter(tab):
-    res = []
-    for row in tab:
-        if row[0].find('usec') < 0:
-            res.append(row)
-    return res
-
-def function_histogram(tab):
-    histo = {}
-    for row in tab:
-        if row[0].find('usec') < 0:
-            g = re.match('.*\s(\w+\.\w+).*;', row[0])
-            if g:
-                f = g.groups(1)[0]
-                if f in histo:
-                    histo[f]+=1
-                else:
-                    histo[f]=1
-    nhisto = []
-    for key,val in histo.items():
-        row=[]
-        row.append(key)
-        row.append(str(val))
-        nhisto.append(row)
-    return nhisto
diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -149,6 +149,7 @@ if(PYTHON3_LIBDIR)
     exportutils.py
     malcheck.py
     sqllogictest.py
+    explain.py
     mapicursor.py
     malmapi.py
     helpers.py
diff --git a/monetdb5/extras/mal_optimizer_template/Tests/explain.py 
b/testing/explain.py
rename from monetdb5/extras/mal_optimizer_template/Tests/explain.py
rename to testing/explain.py
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -290,7 +290,7 @@ class SQLLogic:
             if '.' in pyscript:
                 [mod, fnc] = pyscript.rsplit('.', 1)
                 try:
-                    pymod = importlib.import_module(mod)
+                    pymod = importlib.import_module('MonetDBtesting.' + mod)
                     pyfnc = getattr(pymod, fnc)
                 except ModuleNotFoundError:
                     self.query_error(query, 'cannot import filter function 
module')
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to