-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Catalog: Attach namespace to stream #13923
Changes from 15 commits
ccffa11
097297c
d826cda
8af6e79
50ae513
bff9044
5b9e863
70daccd
2cfe2d2
f54698b
086c7e3
7ca925e
03c3457
edb6ed5
68f7433
2db5885
02c0632
9e13429
0bc2972
8cdfd17
907a626
9ed38f6
c869fbd
71bc9f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ def read_records( | |
|
||
cursor_field = "test_cursor" | ||
primary_key = "primary_key" | ||
namespace = "test_namespace" | ||
|
||
|
||
def test_as_airbyte_stream_incremental(mocker): | ||
|
@@ -71,6 +72,7 @@ def test_as_airbyte_stream_incremental(mocker): | |
|
||
exp = AirbyteStream( | ||
name="stream_stub_incremental", | ||
namespace="test_namespace", | ||
json_schema={}, | ||
supported_sync_modes=[SyncMode.full_refresh, SyncMode.incremental], | ||
default_cursor_field=["test_cursor"], | ||
|
@@ -99,6 +101,35 @@ def test_supports_incremental_cursor_not_set(): | |
assert not test_stream.supports_incremental | ||
|
||
|
||
def test_namespace_set(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should also add tests to verify that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i added the namespace property to the existing test, i hope that is okay? Otherwise, happy to repeat underneath. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks great! |
||
""" | ||
Should allow namespace property to be set. | ||
""" | ||
test_stream = StreamStubFullRefresh() | ||
test_stream.namespace = "test_namespace" | ||
|
||
assert test_stream.namespace == "test_namespace" | ||
|
||
|
||
def test_namespace_set_to_empty_string(): | ||
""" | ||
Should not set namespace property if equal to empty string. | ||
""" | ||
test_stream = StreamStubFullRefresh() | ||
test_stream.namespace = "" | ||
|
||
assert test_stream.namespace == None | ||
|
||
|
||
def test_namespace_not_set(): | ||
""" | ||
Should be equal to unset value of None. | ||
""" | ||
test_stream = StreamStubFullRefresh() | ||
|
||
assert test_stream.namespace == None | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"test_input, expected", | ||
[("key", [["key"]]), (["key1", "key2"], [["key1"], ["key2"]]), ([["key1", "key2"], ["key3"]], [["key1", "key2"], ["key3"]])], | ||
|
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.
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.
Thank you, I have made this requested 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.
Reverted based on discussion below.