Skip to content

Commit 42d506c

Browse files
committed
Issue #4: add todos
1 parent 8e2e09d commit 42d506c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/datasource.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,15 @@ export class QuickwitDataSource
104104
message: 'Cannot save datasource, `index` is required',
105105
};
106106
}
107+
108+
// todo #37 /describe will give you the timeField
107109
if (this.timeField === '' ) {
108110
return {
109111
status: 'error',
110112
message: 'Cannot save datasource, `timeField` is required',
111113
};
112114
}
115+
113116
return lastValueFrom(
114117
from(this.getResource('indexes/' + this.index)).pipe(
115118
mergeMap((indexMetadata) => {
@@ -150,9 +153,12 @@ export class QuickwitDataSource
150153
if (timestampField === undefined) {
151154
return `No field named '${this.timeField}' found in the doc mapping. This should never happen.`;
152155
}
156+
157+
// todo #37: no need anymore, will take the timestampField.field_mapping.output_format anyway
153158
if (timestampField.field_mapping.output_format !== this.timeOutputFormat) {
154159
return `Timestamp output format is declared as '${timestampField.field_mapping.output_format}' in the doc mapping, not '${this.timeOutputFormat}'.`;
155160
}
161+
156162
const supportedTimestampOutputFormats = ['unix_timestamp_secs', 'unix_timestamp_millis', 'unix_timestamp_micros', 'unix_timestamp_nanos', 'iso8601', 'rfc3339'];
157163
if (!supportedTimestampOutputFormats.includes(this.timeOutputFormat)) {
158164
return `Timestamp output format '${this.timeOutputFormat} is not yet supported.`;

0 commit comments

Comments
 (0)