Revision 2542
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
1028 | 1028 |
log_debug('Missing mapping for NOT NULL column '+out_col) |
1029 | 1029 |
remove_all_rows() |
1030 | 1030 |
else: remove_rows(in_col, None) |
1031 |
#except FunctionValueException, e: |
|
1032 |
# log_exc(e) |
|
1033 |
# |
|
1034 |
# assert e.name == out_table.name |
|
1035 |
# out_col = 'value' # assume function param was named "value" |
|
1036 |
# invalid2null(mapping[out_col], e.value) |
|
1031 |
except FunctionValueException, e: |
|
1032 |
log_exc(e) |
|
1033 |
|
|
1034 |
func_name = e.name |
|
1035 |
value = e.value |
|
1036 |
for out_col, in_col in mapping.iteritems(): |
|
1037 |
in_col = sql_gen.remove_col_rename(in_col) |
|
1038 |
if (isinstance(in_col, sql_gen.FunctionCall) |
|
1039 |
and in_col.function.name == func_name): |
|
1040 |
invalid2null(in_col.args[0], value) |
|
1037 | 1041 |
except MissingCastException, e: |
1038 | 1042 |
log_exc(e) |
1039 | 1043 |
|
Also available in: Unified diff
sql.py: put_table(): Re-enabled FunctionValueException handling, by just filtering out the value on all input columns that use the named function (since the error message does not specify which column it was that had the invalid value). This is in some ways better, anyway, because that way the invalid value is filtered out right away in all columns that could contain it, instead of potentially once for each column (if the value appears in more than one input column).