mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) updates from grist-core
This commit is contained in:
commit
b9441cf8fd
@ -15,7 +15,7 @@ FROM node:14-buster as builder
|
|||||||
# Install all node dependencies.
|
# Install all node dependencies.
|
||||||
WORKDIR /grist
|
WORKDIR /grist
|
||||||
COPY package.json yarn.lock /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
|
# Install any extra node dependencies (at root level, to avoid having to wrestle
|
||||||
# with merging them).
|
# with merging them).
|
||||||
@ -23,7 +23,7 @@ COPY --from=ext / /grist/ext
|
|||||||
RUN \
|
RUN \
|
||||||
mkdir /node_modules && \
|
mkdir /node_modules && \
|
||||||
cd /grist/ext && \
|
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.
|
# Build node code.
|
||||||
COPY tsconfig.json /grist
|
COPY tsconfig.json /grist
|
||||||
|
BIN
sandbox/grist/imports/fixtures/test_falsy_cells.xlsx
Normal file
BIN
sandbox/grist/imports/fixtures/test_falsy_cells.xlsx
Normal file
Binary file not shown.
@ -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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -83,7 +83,7 @@ class SimpleDateTimeConverter(BaseConverter):
|
|||||||
def convert(cls, value):
|
def convert(cls, value):
|
||||||
if type(value) is datetime.datetime:
|
if type(value) is datetime.datetime:
|
||||||
return value
|
return value
|
||||||
elif not value:
|
elif value is None:
|
||||||
return None
|
return None
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
|
|
||||||
|
@ -331,6 +331,7 @@ describe('parseDate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle datetimes as formatted by moment', 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
|
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 dateTime = date + ' 12:34:56';
|
||||||
const utcMoment = moment.tz(dateTime, 'UTC');
|
const utcMoment = moment.tz(dateTime, 'UTC');
|
||||||
|
Loading…
Reference in New Issue
Block a user