Skip to content
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

TDL-19959 added missing fields #63

Merged
merged 60 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
41e0404
added missing fields
namrata270998 Jul 21, 2022
39dbb50
TDL-19957 update dict based to class based
namrata270998 Jul 22, 2022
8e00cbd
updated while condition
namrata270998 Jul 22, 2022
f94f68e
updated while condition
namrata270998 Jul 22, 2022
f299b8d
removed incremental_range from REQUIRED_CONFIG_KEYS
namrata270998 Jul 22, 2022
999d32d
TDL-19964 Added missing tap-tester commits
namrata270998 Jul 22, 2022
5f8e433
updated discover and schema file
namrata270998 Jul 22, 2022
b76f9cf
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 25, 2022
86ffe72
updated tap-tester tests
namrata270998 Jul 25, 2022
4353def
updated to replication_key instead of keys
namrata270998 Jul 25, 2022
e0f5029
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 26, 2022
69692b7
updated schemas and added comments
namrata270998 Jul 26, 2022
89d4e4a
added unittests for code coverage
namrata270998 Jul 26, 2022
348262e
updated bookmarks tap-tester test
namrata270998 Jul 26, 2022
140cd09
added unittests for sync.py
namrata270998 Jul 26, 2022
9e27ff2
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 26, 2022
c3e40e2
added parameterized in setup.py
namrata270998 Jul 26, 2022
3249d74
added parameterized in config.yml and updated unittests
namrata270998 Jul 27, 2022
c025e28
Merge branch 'TDL-19957-update-dict-based-to-class-based' of https://…
namrata270998 Jul 27, 2022
8b7163c
updated the replication key to list instead of a single key
namrata270998 Jul 27, 2022
cd435d4
Updated and removed extra comments
namrata270998 Jul 27, 2022
f9989bd
fixed the issue for Keyerror of form_id in answers stream
namrata270998 Jul 27, 2022
bc91c4b
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 27, 2022
3a63e1e
updated unittests
namrata270998 Jul 27, 2022
6621815
updated start date as per format
namrata270998 Jul 27, 2022
8888391
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 27, 2022
4289539
added configurable page size param
namrata270998 Jul 28, 2022
677eea7
updated pagination test case
namrata270998 Jul 28, 2022
dcc12f2
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 28, 2022
26d8dce
handled page_size for 0 and updated unittests
namrata270998 Jul 28, 2022
0dc281b
resolved review comments
namrata270998 Jul 29, 2022
828a5ad
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 29, 2022
ba12410
resolved bug fixes for pagination and removed incompleted_forms_only …
namrata270998 Jul 29, 2022
2600a42
Merge branch 'TDL-19957-update-dict-based-to-class-based' of https://…
namrata270998 Jul 29, 2022
89fae83
updated array type schema
namrata270998 Jul 29, 2022
e3725e6
added new stream unsubmitted landings
namrata270998 Jul 29, 2022
e645182
added new stream in tap-tester
namrata270998 Jul 29, 2022
cd94d7b
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Jul 29, 2022
cfa13f6
updated indentation
namrata270998 Aug 1, 2022
e63152f
resolved PR review comments
namrata270998 Aug 1, 2022
856049f
updated indentation to use 2 spaces
namrata270998 Aug 2, 2022
a15099f
added page_size in example config
namrata270998 Aug 2, 2022
728da16
added back incremental_range in the tap-tester
namrata270998 Aug 2, 2022
d0089aa
fixed the cci issues
namrata270998 Aug 2, 2022
651f0cc
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Aug 2, 2022
aa583be
Merge branch 'TDL-19957-update-dict-based-to-class-based' of https://…
namrata270998 Aug 2, 2022
a5b52bb
added missing fields to a dict
namrata270998 Aug 2, 2022
e580805
added missing assertion for all fields
namrata270998 Aug 2, 2022
5cc0a73
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Aug 2, 2022
c585570
Merge branch 'TDL-19957-update-dict-based-to-class-based' of https://…
namrata270998 Aug 2, 2022
2ab8bdb
updated comment
namrata270998 Aug 2, 2022
c92dd35
raised exc instead of fatal error message and updated unittests
namrata270998 Aug 2, 2022
75e4566
removed get_logger()
namrata270998 Aug 3, 2022
7924ef9
added logger instead of print
namrata270998 Aug 3, 2022
1eb6324
Merge branch 'TDL-19964-add-missing-tap-tester-tests' of https://gith…
namrata270998 Aug 3, 2022
0b76fce
Merge branch 'TDL-19957-update-dict-based-to-class-based' of https://…
namrata270998 Aug 3, 2022
7e39001
Merge branch 'crest-master' into TDL-19959-add-missing-fields
prijendev Aug 29, 2022
ec3546e
Merge branch 'crest-master' into TDL-19959-add-missing-fields
prijendev Aug 29, 2022
3a9ddd1
Updated schema for questions.
prijendev Aug 29, 2022
ebcbe4d
Removed duplicate assertion in all_fields test.
prijendev Sep 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 17 additions & 52 deletions tap_typeform/schemas/forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,88 +5,53 @@
],
"properties": {
"id": {
"type": [
"null",
"string"
]
"type": ["null", "string"]
},
"type": {
"type": [
"null",
"string"
]
"type": ["null", "string"]
},
"title": {
"type": [
"null",
"string"
]
"type": ["null", "string"]
},
"last_updated_at": {
"type": [
"null",
"string"
]
"type": ["null", "string"]
},
"created_at": {
"type": ["null", "string"],
"format": "date-time"
},
"settings": {
"type": [
"null",
"object"
],
"type": ["null", "object"],
"properties": {
"is_public": {
"type": [
"null",
"boolean"
]
"type": ["null", "boolean"]
},
"is_trial": {
"type": [
"null",
"boolean"
]
"type": ["null", "boolean"]
}
}
},
"self": {
"type": [
"null",
"object"
],
"type": ["null", "object"],
"properties": {
"href": {
"type": [
"null",
"string"
]
"type": ["null", "string"]
}
}
},
"theme": {
"type": [
"null",
"object"
],
"type": ["null", "object"],
"properties": {
"href": {
"type": [
"null",
"string"
]
"type": ["null", "string"]
}
}
},
"_links": {
"type": [
"null",
"object"
],
"type": ["null", "object"],
"properties": {
"display": {
"type": [
"null",
"string"
]
"type": ["null", "string"]
}
}
}
Expand Down
258 changes: 228 additions & 30 deletions tap_typeform/schemas/questions.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,234 @@
{
"type": ["null", "object"],
"additionalProperties": false,
"properties": {
"form_id": {
"type": ["null", "string"]
},
"question_id": {
"type": ["null", "string"]
},
"title": {
"type": ["null", "object"],
"additionalProperties": false,
"properties": {
"form_id": {
"type": ["null", "string"]
},
"question_id": {
"type": ["null", "string"]
},
"title": {
"type": ["null", "string"]
},
"ref": {
"type": ["null", "string"]
},
"ref": {
},
"sub_questions": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"question_id": {
"type": ["null", "string"]
},
"title": {
"type": ["null", "string"]
},
"ref": {
"type": ["null", "string"]
}
}
}
},
"attachment": {
"type": ["null", "object"],
"properties": {
"type": {
"type": ["null", "string"]
},
"href": {
"type": ["null", "string"]
},
"scale": {
"type": ["null", "number"]
},
"properties": {
"type": ["null", "object"],
"properties": {
"description": {
"type": ["null", "string"]
}
}
}
}
},
"field_type": {
"type": ["null", "string"]
},
"id": {
"type": ["null", "string"]
},
"layout": {
"type": ["null", "object"],
"properties": {
"type": {
"type": ["null", "string"]
},
"placement": {
"type": ["null", "string"]
},
"attachment": {
"type": ["null", "object"],
"properties": {
"type": {
"type": ["null", "string"]
},
"href": {
"type": ["null", "string"]
},
"scale": {
"type": ["null", "number"]
},
"properties": {
"type": ["null", "object"],
"properties": {
"description": {
"type": ["null", "string"]
}
}
}
}
}
}
},
"name": {
"type": ["null", "string"]
},
"options": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"label": {
"type": ["null", "string"]
},
"sub_questions": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"question_id": {
"type": ["null", "string"]
},
"title": {
"type": ["null", "string"]
},
"ref": {
"type": ["null", "string"]
}
}
}
}
}
}
},
"properties": {
"type": ["null", "object"],
"properties": {
"allow_multiple_selection": {
"type": ["null", "boolean"]
},
"allow_other_choice": {
"type": ["null", "boolean"]
},
"alphabetical_order": {
"type": ["null", "boolean"]
},
"button_text": {
"type": ["null", "string"]
},
"choices": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"attachment": {
"type": ["null", "object"],
"properties": {
"href": {
"type": ["null", "string"]
},
"type": {
"type": ["null", "string"]
}
}
},
"label": {
"type": ["null", "string"]
},
"ref": {
"type": ["null", "string"]
}
}
}
},
"currency": {
"type": ["null", "string"]
},
"default_country_code": {
"type": ["null", "string"]
},
"description": {
"type": ["null", "string"]
},
"fields": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"]
}
},
"hide_marks": {
"type": ["null", "boolean"]
},
"labels": {
"type": ["null", "object"],
"properties": {
"center": {
"type": ["null", "string"]
},
"left": {
"type": ["null", "string"]
},
"right": {
"type": ["null", "string"]
}
}
},
"price": {
"type": ["null", "object"],
"properties": {
"type": {
"type": ["null", "string"]
},
"value": {
"type": ["null", "string"]
}
}
},
"randomize": {
"type": ["null", "boolean"]
},
"separator": {
"type": ["null", "string"]
},
"shape": {
"type": ["null", "string"]
}
}
},
"required": {
"type": ["null", "string"]
},
"type": {
"type": ["null", "string"]
},
"validations": {
"type": ["null", "object"],
"properties": {
"max_length": {
"type": ["null", "integer"]
},
"max_selection": {
"type": ["null", "integer"]
},
"max_value": {
"type": ["null", "integer"]
},
"min_selection": {
"type": ["null", "integer"]
},
"min_value": {
"type": ["null", "integer"]
},
"required": {
"type": ["null", "boolean"]
}
}
}
},
},
"key_properties": ["form_id","question_id"]
}
10 changes: 10 additions & 0 deletions tests/test_typeform_all_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
import tap_tester.menagerie as menagerie
from base import TypeformBaseTest

# As we are not able to generate following fields by Typeform UI, so removed them from expectation list.
KNOWN_MISSING_FIELDS = {
'questions': {
'name',
'field_type',
'required',
'options'
}
}

class TypeformAllFieldsTest(TypeformBaseTest):
"""Ensure running the tap with all streams and fields selected results in the replication of all fields."""
Expand Down Expand Up @@ -66,6 +75,7 @@ def test_run(self):
self.assertTrue(expected_automatic_keys.issubset(
expected_all_keys), msg='{} is not in "expected_all_keys"'.format(expected_automatic_keys-expected_all_keys))
Comment on lines 75 to 76
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion is duplicated on L#88, remove one of the assertion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed duplicate assertion.


expected_all_keys = expected_all_keys - KNOWN_MISSING_FIELDS.get(stream, set())
messages = synced_records.get(stream)
# Collect actual values
actual_all_keys = set()
Expand Down