Skip to content

Commit 705311f

Browse files
author
RuslanBergenov
committed
test: fixed unit schema completeness validation unit test
1 parent 28e4415 commit 705311f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

target_bigquery/validate_json_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def validate_json_schema_completeness(schema_input):
6262
for schema_element, pattern_not_valid in completeness_validation_dict_warning.items():
6363

6464
if pattern_not_valid.search(schema_input_no_spaces):
65-
LOGGER.warning(f"the pipeline might fail because of undefined fields: {schema_element} is defined as {{}}")
65+
LOGGER.warning(f"the pipeline might fail because of undefined fields: an empty {schema_element} indicated as {{}}")
6666

6767

6868
def check_schema_for_dupes_in_field_names(stream_name, schema):

tests/test_schema_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_schema_completeness_validation_empty_dictionary_not_pros_not_type_not_i
102102
for incomplete_schema in invalid_schemas:
103103
validate_json_schema_completeness(incomplete_schema)
104104

105-
expected_log = ('root', 'WARNING', "the pipeline might fail because of undefined fields: {}")
105+
expected_log = ('root', 'WARNING', "the pipeline might fail because of undefined fields: an empty object/dictionary indicated as {}")
106106

107107
logcapture.check(expected_log, )
108108

@@ -117,7 +117,7 @@ def test_several_nested_schemas_mailchimp_validate_completenes(self, logcapture)
117117
if next_schema_input['tap_stream_id'] in ['list_segment_members', 'list_members', 'unsubscribes']:
118118
validate_json_schema_completeness(next_schema_input)
119119

120-
expected_log = ('root', 'WARNING', "the pipeline might fail because of undefined fields: {}")
120+
expected_log = ('root', 'WARNING', "the pipeline might fail because of undefined fields: an empty object/dictionary indicated as {}")
121121

122122
logcapture.check(expected_log, )
123123

0 commit comments

Comments
 (0)