-
Notifications
You must be signed in to change notification settings - Fork 6
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
[DOP-9787] Test strategies when DBReader reads empty source #188
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 08:09
d9bf4c7
to
8571874
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 08:13
8571874
to
d8f41fe
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 08:28
d8f41fe
to
f12dd6b
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 08:36
f12dd6b
to
f1fe008
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 09:07
f1fe008
to
a2b6f51
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 09:59
a2b6f51
to
30c5c26
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 10:00
30c5c26
to
29a9fe3
Compare
dolfinus
changed the title
[DOP-9787] Test case then IncrementalStrategy reads empty source
[DOP-9787] Test strategies when DBReader reads empty source
Dec 13, 2023
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 10:06
29a9fe3
to
94b21c3
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 10:44
94b21c3
to
6c1d2bc
Compare
dolfinus
removed
the
ci:skip-changelog
Add this label to skip changelog file check
label
Dec 13, 2023
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #188 +/- ##
===========================================
+ Coverage 94.19% 94.30% +0.10%
===========================================
Files 204 204
Lines 7684 7705 +21
Branches 1347 1355 +8
===========================================
+ Hits 7238 7266 +28
+ Misses 330 326 -4
+ Partials 116 113 -3 ☔ View full report in Codecov by Sentry. |
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 10:58
6c1d2bc
to
d07a603
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 12:01
d07a603
to
4ad05b9
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 12:06
4ad05b9
to
e8f1751
Compare
dolfinus
force-pushed
the
feature/DOP-9787-tests-strategy-no-data
branch
from
December 13, 2023 12:16
e8f1751
to
f8df474
Compare
maxim-lixakov
approved these changes
Dec 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
If DBReader reads data from source (including empty source), the resulting dataframe contains all the data from the source at the moment of calling
.run()
. But some data is appended to the source after.run()
is called, the result if different for different strategies:SnapshotStrategy
always contains all the source data. This is because no additional filters are applied to original query, and Spark dataframes are lazy..run()
, but not data added to source after it. This is because filters based on current HWM value & strategy are baked into the query.Added tests covering these edge cases.
Handling case
source is empty -> HWM value is None -> cannot apply filter to query -> return e empty dataframe
required adding newlimit
option toDBConnection.read_source_as_df
. Passinglimit=0
returns dataframe which is always empty, which is implementation detail.Also improved behavior of batch strategies - if source contains no data, instead of raising
ValueError
just stop after first iteration, and return empty dataframe.Related issue number
Checklist
docs/changelog/next_release/<pull request or issue id>.<change type>.rst
file added describing change(see CONTRIBUTING.rst for details.)