Skip to content
Open

Xola #181

Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"sourceDefinitionId": "2cfcd96e-72ab-11ec-90d6-0242ac120003",
"name": "Xola",
"dockerRepository": "blotout/source-xola",
"dockerImageTag": "0.1.23",
"dockerImageTag": "0.1.25",
"documentationUrl": "https://github.com/blotoutio/source-xola/README.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@
- sourceDefinitionId: 2cfcd96e-72ab-11ec-90d6-0242ac120003
name: Xola
dockerRepository: blotout/source-xola
dockerImageTag: 0.1.23
dockerImageTag: 0.1.25
documentationUrl: https://github.com/blotoutio/source-xola/README.md
- sourceDefinitionId: c7264528-791f-11ec-90d6-0242ac120003
name: Twitter Ads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6353,7 +6353,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: [ ]
- dockerImage: "blotout/source-xola:0.1.23"
- dockerImage: "blotout/source-xola:0.1.25"
spec:
"documentationUrl": "https://github.com/blotoutio/source-xola/README.md"
"connectionSpecification":
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-xola/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.23
LABEL io.airbyte.version=0.1.25
LABEL io.airbyte.name=blotout/source-xola
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
}
}
},
"items":{
"type":["null","array"],
"default":[],
"items":{
"type":["null","object"],
"properties":{
"id":{
"title":"paymentMethod",
"type":["null","string"]
}
}
}
},
"order_id":{
"type":["null","string"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"travelers":{
"type":["null","string"]
},
"paymentMethod":{
"type":["null","string"]
},
"source":{
"type":["null","string"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
"createdAt": {
"type":["null","string"]
},
"updatedAt": {
"type": ["null", "string"]
},
"createdBy": {
"type": ["null", "string"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import datetime
from abc import ABC
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Dict

Expand Down Expand Up @@ -174,7 +173,7 @@ def request_params(

params['seller'] = self.seller_id
return params

def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapping]:
"""
TODO: Override this method to define how a response is parsed.
Expand All @@ -191,6 +190,9 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp
resp["tags"] = ",".join([tag['id'] for tag in data["tags"]])
else:
resp["tags"] = ""

if "items" in data.keys():
resp["paymentMethod"] = ",".join([item['paymentMethod'] for item in data["items"]])

resp["order_id"] = data["id"]
if "createdAt" in data.keys(): resp["createdAt"] = data["createdAt"]
Expand All @@ -211,8 +213,7 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp
resp["createdBy"] = data["createdBy"]
else:
resp["createdBy"] = ""

#if "quantity" in data.keys(): resp["quantity"] = data["quantity"]

if "event" in data.keys(): resp["event"] = data["event"]
if "amount" in data.keys(): resp["amount"] = data["amount"]
if "updatedAt" in data.keys(): resp["updatedAt"] = data["updatedAt"]
Expand Down Expand Up @@ -453,7 +454,7 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp
class Transactions(IncrementalXolaStream):
primary_key = "id"
seller_id = None
cursor_field = "updatedAt"
cursor_field = "createdAt"

def __init__(self, seller_id: str, x_api_key: str, **kwargs):
super().__init__(x_api_key, **kwargs)
Expand Down