Skip to content

Commit

Permalink
馃悰 Source Retently: Fix invalid json schema for nps stream (#25714)
Browse files Browse the repository at this point in the history
* [FIX] fix nps json schema

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>

* [UPD] bump version to v0.1.4

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>

* [UPD] add PR to changelog

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>

* [UPD] update acceptance test config to new version

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>

* [UPD] schemas

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>

* add nulls to feedback schema, bump dockerfile, metadata.yaml and readme

* remove unused parse function

* [FIX] json schemas

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>

* fix broken schema files

* enable backwards_compatibility for 0.1.5

* add back date-time to outbox.json schema and cast empty strings to null

* refactor: improve handling of empty strings

Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>

---------

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>
Co-authored-by: sajarin <sajarindider@gmail.com>
Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
  • Loading branch information
3 people committed May 19, 2023
1 parent 1c853a7 commit 381f49e
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 166 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-retently/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ COPY source_retently ./source_retently
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.5
LABEL io.airbyte.version=0.1.6
LABEL io.airbyte.name=airbyte/source-retently
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-retently:dev
tests:
acceptance_tests:
spec:
- spec_path: "source_retently/spec.json"
tests:
- spec_path: "source_retently/spec.json"
connection:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "secrets/old_config.json"
status: "succeed"
- config_path: "secrets/config_oauth.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
tests:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "secrets/old_config.json"
status: "succeed"
- config_path: "secrets/config_oauth.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
discovery:
- config_path: "secrets/config.json"
tests:
- config_path: "secrets/config.json"
backward_compatibility_tests_config:
disable_for_version: "0.1.5"
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: ["reports"]
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams:
- name: reports
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: db04ecd1-42e7-4115-9cec-95812905c626
dockerImageTag: 0.1.5
dockerImageTag: 0.1.6
dockerRepository: airbyte/source-retently
githubIssueLabel: source-retently
icon: retently.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"type": "string"
},
"name": {
"type": "string"
"type": ["string", "null"]
},
"isActive": {
"type": "boolean"
"type": ["boolean", "null"]
},
"templateId": {
"type": "string"
"type": ["string", "null"]
},
"metric": {
"type": "string"
"type": ["string", "null"]
},
"type": {
"type": "string"
"type": ["string", "null"]
},
"channel": {
"type": "string"
"type": ["string", "null"]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
{
"type": "object",
"properties": {
"id": { "type": "string" },
"createdDate": { "type": "string" },
"domain": { "type": "string" },
"companyName": { "type": "string" },
"industryName": { "type": "string" },
"id": {
"type": "string"
},
"createdDate": {
"type": ["string", "null"],
"format": "date-time"
},
"domain": {
"type": ["string", "null"]
},
"companyName": {
"type": ["string", "null"]
},
"industryName": {
"type": ["string", "null"]
},
"tags": {
"type": "array",
"items": { "type": "string" }
"items": {
"type": ["string", "null"]
}
},
"cxMetrics": {
"type": "object",
"properties": {
"NPS": { "type": ["number", "null"] },
"CSAT": { "type": ["number", "null"] },
"CES": { "type": ["number", "null"] },
"STAR": { "type": ["number", "null"] }
"NPS": {
"type": ["number", "null"]
},
"CSAT": {
"type": ["number", "null"]
},
"CES": {
"type": ["number", "null"]
},
"STAR": {
"type": ["number", "null"]
}
}
},
"contactsCount": { "type": "number" }
"contactsCount": {
"type": ["number", "null"]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
{
"type": "object",
"additionalProperties": true,
"properties": {
"id": { "type": "string" },
"email": { "type": "string" },
"firstName": { "type": "string" },
"lastName": { "type": "string" },
"companyName": { "type": "string" },
"companyId": { "type": "string" },
"id": {
"type": "string"
},
"email": {
"type": ["string", "null"]
},
"firstName": {
"type": ["string", "null"]
},
"lastName": {
"type": ["string", "null"]
},
"companyName": {
"type": ["string", "null"]
},
"companyId": {
"type": ["string", "null"]
},
"tags": {
"type": "array",
"items": { "type": "string" }
"items": {
"type": ["string", "null"]
}
},
"createdDate": {
"type": ["string", "null"],
"format": "date-time"
},
"createdDate": { "type": "string" },
"properties": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"label": { "type": "string" },
"name": { "type": "string" },
"type": { "type": "string" },
"value": { "type": "string" }
"label": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"value": {
"type": ["string", "integer", "number", "boolean"]
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,62 @@
"type": "object",
"additionalProperties": true,
"properties": {
"companyId": { "type": "string" },
"id": { "type": "string" },
"customerId": { "type": "string" },
"email": { "type": "string" },
"firstName": { "type": "string" },
"lastName": { "type": "string" },
"companyName": { "type": "string" },
"jobTitle": { "type": "string" },
"country": { "type": "string" },
"state": { "type": "string" },
"city": { "type": "string" },
"companyId": { "type": ["null", "string"] },
"id": { "type": ["null", "string"] },
"customerId": { "type": ["null", "string"] },
"email": { "type": ["null", "string"] },
"firstName": { "type": ["null", "string"] },
"lastName": { "type": ["null", "string"] },
"companyName": { "type": ["null", "string"] },
"jobTitle": { "type": ["null", "string"] },
"country": { "type": ["null", "string"] },
"state": { "type": ["null", "string"] },
"city": { "type": ["null", "string"] },
"tags": {
"type": "array",
"items": { "type": "string" }
"type": ["null", "array"],
"items": { "type": ["null", "string"] }
},
"customProps": {
"type": "array",
"items": { "type": "object" }
"type": ["null", "array"],
"items": { "type": ["null", "object"] }
},
"campaignId": { "type": "string" },
"campaignName": { "type": "string" },
"createdDate": { "type": "string" },
"score": { "type": "number" },
"comment": { "type": "string" },
"checkbox": { "type": "boolean" },
"campaignId": { "type": ["null", "string"] },
"campaignName": { "type": ["null", "string"] },
"createdDate": { "type": ["null", "string"] },
"score": { "type": ["null", "number"] },
"comment": { "type": ["null", "string"] },
"checkbox": { "type": ["null", "boolean"] },
"additionalQuestions": {
"type": "array",
"items": { "type": "object" }
"type": ["null", "array"],
"items": { "type": ["null", "object"] }
},
"feedbackTags": {
"type": "array",
"items": { "type": "string" }
"type": ["null", "array"],
"items": { "type": ["null", "string"] }
},
"feedbackTagsNew": {
"type": ["null", "array"]
},
"feedbackTopics": {
"type": ["null", "array"],
"items": {
"type": "object",
"properties": {
"name": { "type": ["null", "string"] },
"sentiment": { "type": ["null", "string"] }
}
}
},
"notes": {
"type": "array",
"items": { "type": "object" }
"type": ["null", "array"],
"items": { "type": ["null", "object"] }
},
"status": { "type": "string" },
"assigned": { "type": "string" },
"ratingCategory": { "type": "string" },
"resolved": { "type": "boolean" },
"channel": { "type": "string" },
"metricsType": { "type": "string" },
"isBogus": { "type": "boolean" }
"status": { "type": ["null", "string"] },
"assigned": { "type": ["null", "string"] },
"ratingCategory": { "type": ["null", "string"] },
"resolved": { "type": ["null", "boolean"] },
"channel": { "type": ["null", "string"] },
"metricsType": { "type": ["null", "string"] },
"isBogus": { "type": ["null", "boolean"] }
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"properties": {
"score": { "type": "integer" },
"scoreSum": { "type": "integer" },
"metricsType": { "type": "string" },
"promoters": { "type": "integer" },
"passives": { "type": "integer" },
"detractors": { "type": "integer" },
"promotersCount": { "type": "integer" },
"passivesCount": { "type": "integer" },
"detractorsCount": { "type": "integer" },
"totalResponses": { "type": "integer" }
"score": {
"type": ["integer", "null"]
},
"scoreSum": {
"type": ["integer", "null"]
},
"metricsType": {
"type": ["string", "null"]
},
"promoters": {
"type": ["integer", "null"]
},
"passives": {
"type": ["integer", "null"]
},
"detractors": {
"type": ["integer", "null"]
},
"promotersCount": {
"type": ["integer", "null"]
},
"passivesCount": {
"type": ["integer", "null"]
},
"detractorsCount": {
"type": ["integer", "null"]
},
"totalResponses": {
"type": ["integer", "null"]
}
}
}

0 comments on commit 381f49e

Please sign in to comment.