Skip to content
Snippets Groups Projects
Commit 1f836501 authored by Pietro Cavassin's avatar Pietro Cavassin
Browse files

Merge branch 'insert_update' into 'development'

updating insert functions

See merge request !16
parents 52e71cf5 f8cf2a8a
No related branches found
No related tags found
1 merge request!16updating insert functions
...@@ -53,6 +53,7 @@ def temporary_data(connection, file_name, table, year, offset=2, ...@@ -53,6 +53,7 @@ def temporary_data(connection, file_name, table, year, offset=2,
table.populate_temporary(ttable, file_name, header, year, delimiters, null, offset, bind=connection) table.populate_temporary(ttable, file_name, header, year, delimiters, null, offset, bind=connection)
table.apply_derivatives(ttable, ttable.columns.keys(), year, bind=connection) table.apply_derivatives(ttable, ttable.columns.keys(), year, bind=connection)
table.add_pk_to_temporary(ttable, bind=connection) table.add_pk_to_temporary(ttable, bind=connection)
return ttable return ttable
......
...@@ -908,10 +908,13 @@ class DatabaseTable(Table): ...@@ -908,10 +908,13 @@ class DatabaseTable(Table):
''' '''
if bind is None: if bind is None:
bind = self.metadata.bind bind = self.metadata.bind
for original in columns: for original in columns:
self._resolv_derivative(original, year) self._resolv_derivative(original, year)
if (len(self._derivatives) == 0):
return;
max_level = max([self._derivatives[d]['level'] for d in self._derivatives]) max_level = max([self._derivatives[d]['level'] for d in self._derivatives])
for i in range(1, max_level + 1): for i in range(1, max_level + 1):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment