(core) updates from grist-core

This commit is contained in:
Paul Fitzpatrick
2022-09-12 09:14:22 -04:00
5 changed files with 21 additions and 3 deletions

Binary file not shown.

View File

@@ -189,5 +189,22 @@ class TestImportXLS(unittest.TestCase):
],
}])
def test_falsy_cells(self):
# Falsy cells should be parsed as Numeric, not Date.
parsed_file = import_xls.parse_file(*_get_fixture('test_falsy_cells.xlsx'))
tables = parsed_file[1]
self.assertEqual(tables, [{
'table_name': 'Sheet1',
'column_metadata': [
{'id': u'A', 'type': 'Numeric'},
{'id': u'B', 'type': 'Numeric'},
],
'table_data': [
[0, 0],
[0, 0],
],
}])
if __name__ == '__main__':
unittest.main()

View File

@@ -83,7 +83,7 @@ class SimpleDateTimeConverter(BaseConverter):
def convert(cls, value):
if type(value) is datetime.datetime:
return value
elif not value:
elif value is None:
return None
raise ValueError()