Table generator: For unit conversion, sourceUnit must only be specified if it is not ''
@@ -218,12 +218,13 @@ def _get_decimal_digits(decimal_number_match, number_of_significant_digits):
def _check_unit_consistency(actual_unit, wanted_unit):
- if wanted_unit is None:
+ if actual_unit and wanted_unit is None:
raise TypeError("Trying to convert from one unit to another, but source unit not specified")
elif wanted_unit != actual_unit:
raise TypeError("Source value of different unit than specified source unit: " +
actual_unit + " and " + wanted_unit)
+
def _get_column_type_heur(column, column_values):
text_type_tuple = ColumnType.text, None
