Skip to content

Commit

Permalink
TDL-21114 add tags property for submitted_landings stream (#75)
Browse files Browse the repository at this point in the history
* add tags property

* update unitests

* changelog and version bump

* add null as possible value

* use .get to fetch tags data

* formatting

* remove null datatype

* keep null as datatype
  • Loading branch information
kethan1122 authored May 31, 2023
1 parent 8eef619 commit ad804ac
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.2.0
* Adds `tags` property to `submitted_landings` stream [#75](https://github.com/singer-io/tap-typeform/pull/75)

## 2.1.0
* Fixes/Handles following [#73](https://github.com/singer-io/tap-typeform/pull/73)
* Syncs data for all forms if `forms` field is missing in config and makes the field as optional
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="tap-typeform",
version="2.1.0",
version="2.2.0",
description="Singer.io tap for extracting data from the TypeForm Responses API",
author="bytcode.io",
url="http://singer.io",
Expand Down
6 changes: 6 additions & 0 deletions tap_typeform/schemas/submitted_landings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
"hidden": {
"type": ["null", "string"]
},
"tags": {
"type": ["null", "array"],
"items": {
"type": ["null", "string"]
}
},
"_sdc_form_id": {
"type": ["null", "string"]
}
Expand Down
1 change: 1 addition & 0 deletions tap_typeform/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def add_fields_at_1st_level(self, record, additional_data={}):
Add additional data and nested fields to top level
"""
record.update({
"tags": record.get("tags"),
"_sdc_form_id": additional_data["_sdc_form_id"],
"user_agent": record["metadata"]["user_agent"],
"platform": record["metadata"]["platform"],
Expand Down
6 changes: 4 additions & 2 deletions tests/unittests/test_sync_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ class TestAddFieldAt1StLevel(unittest.TestCase):
"referer": "",
"network_id": "",
"browser": "default"
}
},
"tags": ["noodle", "weekly"]
}
sub_landings_exp_record = {
**sub_landings_record,
Expand All @@ -232,7 +233,8 @@ class TestAddFieldAt1StLevel(unittest.TestCase):
"network_id": "",
"browser": "default",
"hidden": "",
"_sdc_form_id": "form1"
"tags": ["noodle", "weekly"],
"_sdc_form_id": "form1",
}
unsub_landings_record = {
"metadata": {
Expand Down

0 comments on commit ad804ac

Please sign in to comment.