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
38 stars 49 forks source link

Remove duplicate code #655

Closed pooja1pathak closed 2 years ago

pooja1pathak commented 2 years ago

Remove duplicate code mentioned at:

https://github.com/orchestracities/ngsi-timeseries-api/blob/81351ec96f87175de253dbfc26c8dfbdf3062cd3/src/reporter/tests/test_timescale_types.py#L31

NEC-Vishal commented 2 years ago

Hi @chicco785 @c0c0n3 I have checked the code of test_timescale_type.py and get noting duplicate , also I have checked test files in translator but there is also noting to check . can you please clarify this TODO ?

NEC-Vishal commented 2 years ago

Hi @chicco785 @c0c0n3 as per my analysis, I found that gen_tenant_id() is common function used in some files of translator and reporter section. image

so I am thinking of making a separate file named tenant.py in src/utils and then import that file to all files that contain the duplicate function. this will remove the duplicity in files.

Please guide me!

c0c0n3 commented 2 years ago

@NEC-Vishal that's great, thanks a stack. if you could please put the new file in the tests dir, i.e. src/utils/tests/tenant.py.

NEC-Vishal commented 2 years ago

@NEC-Vishal that's great, thanks a stack. if you could please put the new file in the tests dir, i.e. src/utils/tests/tenant.py.

Hi @c0c0n3 modifications are completed, please check!

c0c0n3 commented 2 years ago

Hi @NEC-Vishal, see my comments to #657

pooja1pathak commented 2 years ago

Closing as PR #657 is merged.