orchestracities / ngsi-timeseries-api

QuantumLeap: a FIWARE Generic Enabler to support the usage of NGSIv2 (and NGSI-LD experimentally) data in time-series databases
https://quantumleap.rtfd.io/
MIT License
37 stars 49 forks source link

Resolve TODO #682

Closed pooja1pathak closed 1 year ago

pooja1pathak commented 1 year ago

Resolve TODO: https://github.com/orchestracities/ngsi-timeseries-api/blob/af8877cd2b5909c67819d8a93e3b58bce6a61fdb/src/reporter/tests/test_timescale_types.py#L108

NEC-Vishal commented 1 year ago

Hi @c0c0n3

I think this factor out can not be solved, it looks like gen_entity() in test_timescale_insert module in translators.tests. but there are lot of differences in attributes, some of the attributes in reporter.tests.test_timescale_types.py not in other gen_entity()

TIMEX_ATTR_NAME: { 'type': NGSI_DATETIME, 'value': timex }, BOOL_ATTR_NAME: { 'type': 'Boolean', 'value': bool_v }, INT_ATTR_NAME: { 'type': 'Integer', 'value': int_v }, NUM_ATTR_NAME: { 'type': 'Number', 'value': num_v }, TEXT_ATTR_NAME: { 'type': NGSI_TEXT, 'value': text_v }, ARR_ATTR_NAME: { 'type': 'Array', 'value': array_v }, SV_ATTR_NAME: { 'type': NGSI_STRUCTURED_VALUE, 'value': structured_v }, GEOJ_ATTR_NAME: { 'type': NGSI_GEOJSON, 'value': geoj_v }, PT_ATTR_NAME: { 'type': SlfPoint.ngsi_type(), 'value': slf_point_v }, LINE_ATTR_NAME: { 'type': SlfLine.ngsi_type(), 'value': slf_line_v }, POLY_ATTR_NAME: { 'type': SlfPolygon.ngsi_type(), 'value': slf_polygon_v }, BOX_ATTR_NAME: { 'type': SlfBox.ngsi_type(), 'value': slf_box_v }

 These attributes are not there in gen_entity of translators.tests.test_timescale_insert()

 can you Please suggest me a way?
c0c0n3 commented 1 year ago

@NEC-Vishal I totally agree w/ your analysis, thanks for that. It looks like the code has diverged since that TODO was written. I think the only sane thing to do at this stage is to keep things as they are? If you agree we could ditch #685 and close this issue.

c0c0n3 commented 1 year ago

@NEC-Vishal I closed #685 and going to close this issue, if you don't agree, please reopen :-)