monosidev / monosi

Open source data observability platform
Apache License 2.0
319 stars 32 forks source link

Test DataSource call: Fix indexing #180

Open unkrich opened 2 years ago

unkrich commented 2 years ago

Description

Currently we provide functionality to test whether we are correctly connected to a data source. In this method, we rely on an exception happening rather than truly checking whether the response is correct due to the fact that we index on a theoretically empty array.

See: https://github.com/monosidev/monosi/blob/master/src/ingestion/sources/base.py#L169

The shortest solultion might be something like

return len(rows) > 1 and len(rows[0]) > 1 and rows[0][columns[0]] == 1

Expected behavior

It's expected that we do not throw an error here even if we are not truly connected, though it is still likely despite fixing indexing. Ideally we would fix indexing and catch specific errors related to not actually connecting.

ghost commented 2 years ago

Hi, I am a beginner. Can I contribute to this?

iporollo commented 2 years ago

@ShreyasB92 of course! Thanks for offering to help here, let us know if you have any questions. Will assign the issue to you.