From ff69e0f86039cbe899c780f42b7c2bc4c2d16f45 Mon Sep 17 00:00:00 2001
From: Michael Rudolf <rudolf@geo.tu-darmstadt.de>
Date: Tue, 28 Jan 2025 11:33:42 +0100
Subject: [PATCH] Fixed a bug that generated wrong sql queries.

---
 u4py/io/sql.py                             | 4 ++--
 u4py/scripts/plotting/plot_psi_as_tiffs.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/u4py/io/sql.py b/u4py/io/sql.py
index 441fb90..f884405 100644
--- a/u4py/io/sql.py
+++ b/u4py/io/sql.py
@@ -473,12 +473,12 @@ def gen_timeseries_queries(
     time = np.array([u4conv.sql_key_to_time(k) for k in key_list])
     if where:
         queries = [
-            (file_path, f"SELECT {k} FROM '{table}' WHERE {where}", jj)
+            (file_path, f'SELECT "{k}" FROM "{table}" WHERE {where}', jj)
             for jj, k in enumerate(key_list)
         ]
     else:
         queries = [
-            (file_path, f"SELECT {k} FROM '{table}'", jj)
+            (file_path, f'SELECT "{k}" FROM "{table}"', jj)
             for jj, k in enumerate(key_list)
         ]
     return time, queries
diff --git a/u4py/scripts/plotting/plot_psi_as_tiffs.py b/u4py/scripts/plotting/plot_psi_as_tiffs.py
index 790a57e..36b59ba 100644
--- a/u4py/scripts/plotting/plot_psi_as_tiffs.py
+++ b/u4py/scripts/plotting/plot_psi_as_tiffs.py
@@ -22,7 +22,7 @@ def main():
     project = u4proj.get_project(
         required=["base_path"],
         proj_path=Path(
-            "~/Documents/umwelt4/Convert_EGMS_to_Tiff.u4project"
+            "~/Documents/umwelt4/Convert_EGMS_gpkg_to_tif.u4project"
         ).expanduser(),
     )
     folder_list = [
-- 
GitLab