(core) updates from grist-core

pull/281/head
Paul Fitzpatrick 2 years ago
commit b9441cf8fd

@ -15,7 +15,7 @@ FROM node:14-buster as builder
# Install all node dependencies.
WORKDIR /grist
COPY package.json yarn.lock /grist/
RUN yarn install --frozen-lockfile --verbose
RUN yarn install --frozen-lockfile --verbose --network-timeout 600000
# Install any extra node dependencies (at root level, to avoid having to wrestle
# with merging them).
@ -23,7 +23,7 @@ COPY --from=ext / /grist/ext
RUN \
mkdir /node_modules && \
cd /grist/ext && \
{ if [ -e package.json ] ; then yarn install --frozen-lockfile --modules-folder=/node_modules --verbose ; fi }
{ if [ -e package.json ] ; then yarn install --frozen-lockfile --modules-folder=/node_modules --verbose --network-timeout 600000 ; fi }
# Build node code.
COPY tsconfig.json /grist

@ -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()

@ -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()

@ -331,6 +331,7 @@ describe('parseDate', function() {
});
it('should handle datetimes as formatted by moment', function() {
this.timeout(10000); // there may be a LOT of timezone names.
for (const date of ['2020-02-03', '2020-06-07', '2020-10-11']) { // different months for daylight savings
const dateTime = date + ' 12:34:56';
const utcMoment = moment.tz(dateTime, 'UTC');

Loading…
Cancel
Save