From bd407e439c4a7d9239b82822f1574ae8f9554e35 Mon Sep 17 00:00:00 2001 From: Florent Arpin-Pont Date: Wed, 27 Jan 2016 12:34:50 +0100 Subject: [PATCH] MySQL/linux case sensitive compatibility Hi all, I use "LittleBear_ODM_1.1.1_MySQL.sql" example database with linux 64bit based platform. After executing this sql code, database was created and I could explore it (through phphmyadmin). Launching ODMTools, I give database coordinates and application tries to connect, unsuccessfully. Issue was about table names which were all lower case whereas ODMTools expected upper case like "DataValues" instead of "datavalues". So I changed all table names (except for "seriescatalog" which was still expected lower case). Then ODMTools opened successfully and I could explore all the data series. I then tried to make some edits (see also "Lasso widget disabled " issue). After saving edits, ODM could retrieve new variable (with Quality control level set to 1) in table "seriescatalog" but no data were shown on graph. In fact, these data had been written in a new table called "datavalues". This table has been created by ODMTools at the time I saved my edits. I could fix this issue by changing line 525 in file in odmtools/odmservices/series_service.py to : ```python values.to_sql(name="DataValues", if_exists='append', con=self._session_factory.engine, index=False) ## FAP 160127 ``` instead of : ```python values.to_sql(name="datavalues", if_exists='append', con=self._session_factory.engine, index=False) ``` Please find attached the file I modified in Pull request "MySQL/linux case sensitive compatibility" Best regards, Florent --- odmtools/odmservices/series_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odmtools/odmservices/series_service.py b/odmtools/odmservices/series_service.py index 7c8ccc4..9c3c393 100644 --- a/odmtools/odmservices/series_service.py +++ b/odmtools/odmservices/series_service.py @@ -522,7 +522,7 @@ def save_values(self, values): :param values: pandas dataframe :return: """ - values.to_sql(name="datavalues", if_exists='append', con=self._session_factory.engine, index=False) + values.to_sql(name="DataValues", if_exists='append', con=self._session_factory.engine, index=False) ## FAP 160127 def create_new_series(self, data_values, site_id, variable_id, method_id, source_id, qcl_id): @@ -779,4 +779,4 @@ def variable_exists(self, v): no_data_value=v.no_data_value).one() return result except: - return None \ No newline at end of file + return None