-
Notifications
You must be signed in to change notification settings - Fork 50
Fix snowflake stage not being deleted on error in load_file #1321
Conversation
Codecov ReportBase: 95.71% // Head: 94.99% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1321 +/- ##
==========================================
- Coverage 95.71% 94.99% -0.73%
==========================================
Files 19 71 +52
Lines 677 3315 +2638
Branches 68 382 +314
==========================================
+ Hits 648 3149 +2501
- Misses 18 102 +84
- Partials 11 64 +53
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
sunank200
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
kaxil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the test is failing - https://github.com/astronomer/astro-sdk/actions/runs/3572950837/jobs/6007534322
| except AttributeError: | ||
| try: | ||
| rows = self.hook.run(sql_statement) | ||
| except (AttributeError, ValueError) as exe: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the AttributeError from here. Could anyone explain to me why we are catching these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaxil @utkarsharma2 @sunank200 maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it now its working without AttributeError
sunank200
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AttributeError would be required as this is raised by snowflake for which we should fallback if enabled by the user. Related to #1324
fdbff1f to
53ceb15
Compare
…r/astro-sdk into delete-snowflake-stage
Tested it without |
# Description ## What is the current behavior? Currently the snowflake stage is not being dropped incase of an exception when calling `load_file`. closes: #1262 ## What is the new behavior? Drop snowflake stage also when file load failed. ## Does this introduce a breaking change? No. ### Checklist - [x] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary Co-authored-by: rajaths010494 <rajath.srinivasaiah@astronomer.io> Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com> (cherry picked from commit 7e829af)
Description
What is the current behavior?
Currently the snowflake stage is not being dropped incase of an exception when calling
load_file.closes: #1262
What is the new behavior?
Drop snowflake stage also when file load failed.
Does this introduce a breaking change?
No.
Checklist