monosi
monosi copied to clipboard
Test DataSource call: Fix indexing
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.
Hi, I am a beginner. Can I contribute to this?
@ShreyasB92 of course! Thanks for offering to help here, let us know if you have any questions. Will assign the issue to you.