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

Change catching ValueError and AttributeError to DatabaseCustomError #595

Merged
merged 5 commits into from
Aug 4, 2022

Conversation

sunank200
Copy link
Contributor

Description

What is the current behavior?

Currently in Snowflake load_file, ValueError and AttributeError are being catched at function level but it should be caught at the line and thrown that error.

closes: #583

What is the new behavior?

  • Create class DatabaseCustomError to raise generic errors like ValueError and AttributeError
  • Raise the specific errors and change the tests.

Does this introduce a breaking change?

No

Checklist

  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary

@sunank200 sunank200 added bug Something isn't working priority/critical Critical priority labels Jul 29, 2022
@sunank200 sunank200 self-assigned this Jul 29, 2022
@codecov
Copy link

codecov bot commented Jul 29, 2022

Codecov Report

Merging #595 (9590976) into main (6b90c92) will increase coverage by 0.45%.
The diff coverage is 94.73%.

@@            Coverage Diff             @@
##             main     #595      +/-   ##
==========================================
+ Coverage   92.80%   93.26%   +0.45%     
==========================================
  Files          41       41              
  Lines        1655     1663       +8     
  Branches      210      211       +1     
==========================================
+ Hits         1536     1551      +15     
+ Misses         93       89       -4     
+ Partials       26       23       -3     
Impacted Files Coverage Δ
src/astro/databases/google/bigquery.py 97.41% <85.71%> (+2.64%) ⬆️
src/astro/databases/base.py 96.10% <100.00%> (+0.70%) ⬆️
src/astro/databases/snowflake.py 96.85% <100.00%> (+1.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sunank200 sunank200 merged commit 1d03242 into main Aug 4, 2022
@sunank200 sunank200 deleted the catch-errors-at-line branch August 4, 2022 14:38
utkarsharma2 pushed a commit that referenced this pull request Aug 8, 2022
…595)

* Change catching ValueError and AttributeError to DatabaseCustomError

* Add test for DatabaseCustomError

* Raise and show exception message
kaxil pushed a commit that referenced this pull request Aug 18, 2022
…595)

* Change catching ValueError and AttributeError to DatabaseCustomError

* Add test for DatabaseCustomError

* Raise and show exception message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/critical Critical priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catch for ValueError and AtributeError in fallback at specific call in loadFile
2 participants