-
Notifications
You must be signed in to change notification settings - Fork 324
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
delete: add possibility to soft-delete datasets and jobs #2032
Conversation
0cb0b76
to
cf50ad0
Compare
This looks really great. The only inconsistency I see is that:
What if we introduced |
c6a5a86
to
bc7e1f6
Compare
bc7e1f6
to
deb00a6
Compare
Codecov Report
@@ Coverage Diff @@
## main #2032 +/- ##
============================================
+ Coverage 75.11% 75.14% +0.03%
- Complexity 1020 1023 +3
============================================
Files 202 202
Lines 4798 4836 +38
Branches 392 392
============================================
+ Hits 3604 3634 +30
- Misses 754 762 +8
Partials 440 440
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
ab7641f
to
4b8efd7
Compare
@pawel-big-lebowski changed how this works. Now it all references view. |
@wslulciuc can you take a look? Also, can you think of any additional tests this might need? |
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 fell in love with testLineageWithDeletedDataset
test ❤️
&& jobNameEquals(n, "downstreamJob0<-outputData<-readJob0<-commonDataset")) | ||
.isEmpty(); | ||
} | ||
|
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.
That's a great test! 💯 🥇
Next time I won't change query formatting AND query itself in one PR - it makes resolving conflicts unpleasant 😞 |
4b8efd7
to
ae95250
Compare
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 have two main comments:
- if I agree that the sql reformatting with triple quotes is good, this should be done in a separate PR. Mixing refactoring/reformatting with same behavior and change of behavior in the same PR makes it difficult to review. We should avoid doing that in the future.
- personally I would prefer we call this "delete". It is a soft delete since all the versions are maintained but it is a delete as these jobs and dataset don't exist anymore. If they do they just get undeleted the next time they run or get read/written.
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
ae95250
to
25b7d66
Compare
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
25b7d66
to
17aaa8f
Compare
First part of #1736 - ability to "soft delete" datasets and jobs - API to "hide" them which can be used from UI; the reason for adding this is process to hiding inactive datasets and jobs. This PR does not include the UI part.
The feature works by adding
is_hidden
flag to both datasets and jobs tables. Then, it changesjobs_view
and addsdatasets_view
that hide rows whereis_hidden
flag is set to true value. This makes writing proper queries easier, since, you don't need to do this filtering manually everywhere as long as you use this view.The soft-delete is reversed if the job or dataset is updated again - new version reverts the flag.
Signed-off-by: Maciej Obuchowski obuchowski.maciej@gmail.com