Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdk-core: simplify error message for send_**_for_ingestion #2787

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

antoniivanov
Copy link
Collaborator

@antoniivanov antoniivanov commented Oct 11, 2023

There were a couple of issues with error handling that are fixedhere

  1. Inconsistent behaviour between send_xxx methods. One method was swallowing the error while the other was re-throwing it . This is fixe by both rethrowing it.

  2. Remove the unecessary error message. It is redundant and doesn't provide any new information that is not availbe in the raised exception

  3. When "rows" argument was not iterabot nor cursor or iterable raised custom exceptin, it always failed with cryptic error AttributeError: 'BrokenIterator' object has no attribute 'fetchmany' This is fixed by using more appropriate if statement to cehck type of rows and raising InvalidArgumentsIngestionException if it's the wrong type.

Consolited some tests in function/ingestion module. There was no test covering the scenario of using multiple methods and it is added.

Testing Done: beyond automated test see

There were a couple of issues with error handling that are fixedhere

1. Inconsistent behaviour between send_xxx methods. One method was
swallowing the error while the other was re-throwing it . This is fixe
by both rethrowing it.

2. Remove the unecessary error message. It is redundant and doesn't
provide any new information that is not availbe in the raised exception

3. When "rows" argument was not iterabot nor cursor or iterable raised
custom exceptin,  it always failed with cryptic error ` AttributeError:
'BrokenIterator' object has no attribute 'fetchmany' `
This is fixed by using more appropriate if statement to cehck type of
rows and raising InvalidArgumentsIngestionException if it's the wrong
type.

Consolited some tests in function/ingestion module.
There was no test covering the scenario of using multiple methods and it
is added.
@antoniivanov antoniivanov force-pushed the person/aivanov/vdk-core-errors branch from 6132bef to 784f29b Compare October 11, 2023 09:45
@antoniivanov antoniivanov enabled auto-merge (squash) October 11, 2023 09:49
@antoniivanov antoniivanov merged commit f0dc501 into main Oct 11, 2023
@antoniivanov antoniivanov deleted the person/aivanov/vdk-core-errors branch October 11, 2023 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants