-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Source-acceptance-test: improvements #3888
Conversation
@@ -51,11 +51,12 @@ def future_state_fixture(future_state_path) -> Path: | |||
|
|||
@pytest.fixture(name="cursor_paths") | |||
def cursor_paths_fixture(inputs, configured_catalog_for_incremental) -> Mapping[str, Any]: | |||
cursor_paths = getattr(inputs, "cursor_paths") | |||
cursor_paths = getattr(inputs, "cursor_paths", None) |
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.
cursor_paths = getattr(inputs, "cursor_paths", None) | |
cursor_paths = getattr(inputs, "cursor_paths", {}) |
result = {} | ||
|
||
for stream in configured_catalog_for_incremental.streams: | ||
path = cursor_paths.get(stream.stream.name, [stream.cursor_field[-1]]) | ||
default_ = [stream.cursor_field[-1]] |
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.
then you don't need to change anythin here
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 with some comments.
Can you create a follow up PR which renames state_path
in all connectors?
Also you will need to publish the SAT docker image
stream.cursor_field = stream.stream.default_cursor_field[:] | ||
else: | ||
pytest.fail( | ||
"Configured catalog should have `cursor_field` " "either `default_cursor_field` specified for all incremental streams" |
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.
suggested wording improvement
"Configured catalog should have `cursor_field` " "either `default_cursor_field` specified for all incremental streams" | |
f"All incremental streams should either have `cursor_field` declared in the configured catalog or `default_cursor_field` specified in the catalog output by discover. Stream {stream.stream.name} does not have either property defined." |
@@ -51,7 +51,7 @@ def future_state_fixture(future_state_path) -> Path: | |||
|
|||
@pytest.fixture(name="cursor_paths") | |||
def cursor_paths_fixture(inputs, configured_catalog_for_incremental) -> Mapping[str, Any]: | |||
cursor_paths = getattr(inputs, "cursor_paths") | |||
cursor_paths = getattr(inputs, "cursor_paths") or {} |
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.
what is the impact of this change?
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.
cursor_paths = getattr(inputs, "cursor_paths") returns None if cursor_paths are commented in yaml. This case will fail few lines below on cursor_paths.get
00091f8
to
64f75ec
Compare
/publish connector=bases/source-acceptance-test
|
Closes #3467
How
By solving listed issues described in the issue.
Please note, that solving (3) issue makes old
acceptance-test-config.yml
files incompatible, because it contains oldstate_path
field and does not contain requiredfuture_state_path
. Config field need to be overwritten.