intrinsic_metadata.http://schema.org/softwareVersion.@value is infered as type float
Fix causes the following error when a version cannot be parsed as a float:
https://sentry.softwareheritage.org/organizations/swh/issues/10436/?referrer=phabricator_plugin
BulkIndexError: ('1 document(s) failed to index.', [{'update': {'_index': 'origin-v0.11', '_type': '_doc', '_id': '318e94b3cf448b1064c1668609e017e2fbcaa419', 'status': 400, 'error': {'type': 'mapper_parsing_exception', 'reason': "failed to parse field [intrinsic_metadata.http://schema.org/softwareVersion.@value] of type [float] in document with id '318e94b3cf448b1064c1668609e017e2fbcaa419'. Preview of field's value: 'v0.6.2.dev1+ga234179'", 'caused_by': {'type': 'number_format_exception', 'reason': 'For input string: "v...
(5 additional frame(s) were not displayed)
...
File "swh/search/metrics.py", line 23, in d
return f(*a, **kw)
File "swh/search/elasticsearch.py", line 339, in origin_update
indexed_count, errors = helpers.bulk(self._backend, actions, index=write_index)
File "elasticsearch/helpers/actions.py", line 300, in bulk
for ok, item in streaming_bulk(client, actions, *args, **kwargs):
File "elasticsearch/helpers/actions.py", line 230, in streaming_bulk
**kwargs
File "elasticsearch/helpers/actions.py", line 158, in _process_bulk_chunk
raise BulkIndexError("%i document(s) failed to index." % len(errors), errors)
('1 document(s) failed to index.', [{'update': {'_index': 'origin-v0.11', '_type': '_doc', '_id': '318e94b3cf448b1064c1668609e017e2fbcaa419', 'status': 400, 'error': {'type': 'mapper_parsing_exception', 'reason': "failed to parse field [intrinsic_metadata.http://schema.org/softwareVersion.@value] of type [float] in document with id '318e94b3cf448b1064c1668609e017e2fbcaa419'. Preview of field's value: 'v0.6.2.dev1+ga234179'", 'caused_by': {'type': 'number_format_exception', 'reason': 'For input string: "v...
cause is:
failed to parse field [intrinsic_metadata.http://schema.org/softwareVersion.@value] of type [float] in document with id '318e94b3cf448b1064c1668609e017e2fbcaa419'. Preview of field's value: 'v0.6.2.dev1+ga234179'
Migrated from T4396 (view on Phabricator)