monosi icon indicating copy to clipboard operation
monosi copied to clipboard

Test DataSource call: Fix indexing

Open unkrich opened this issue 2 years ago • 2 comments

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.

unkrich avatar Apr 13 '22 18:04 unkrich

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

ghost avatar Apr 14 '22 22:04 ghost

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

iporollo avatar Apr 15 '22 22:04 iporollo