Skip to content

Commit 06f8a2b

Browse files
✨ Destination Timeplus: fix issues in README and upgrade timeplus and cdk (#44758)
Co-authored-by: Marcos Marx <[email protected]>
1 parent e24fcd7 commit 06f8a2b

File tree

8 files changed

+681
-65
lines changed

8 files changed

+681
-65
lines changed

airbyte-integrations/connectors/destination-timeplus/README.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Timeplus source connector
1+
# Timeplus destination connector
22

33

44
This is the repository for the Timeplus source connector, written in Python.
@@ -7,7 +7,7 @@ For information about how to use this connector within Airbyte, see [the documen
77
## Local development
88

99
### Prerequisites
10-
* Python (~=3.9)
10+
* Python (~=3.10)
1111
* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
1212

1313

@@ -29,8 +29,7 @@ See `sample_files/sample_config.json` for a sample config file.
2929
```
3030
poetry run destination-timeplus spec
3131
poetry run destination-timeplus check --config secrets/config.json
32-
poetry run destination-timeplus discover --config secrets/config.json
33-
poetry run destination-timeplus read --config secrets/config.json --catalog sample_files/configured_catalog.json
32+
cat integration_tests/messages.jsonl | poetry run destination-timeplus write --config secrets/config.json --catalog integration_tests/configured_catalog.json
3433
```
3534

3635
### Running unit tests
@@ -54,8 +53,7 @@ Then run any of the connector commands as follows:
5453
```
5554
docker run --rm airbyte/destination-timeplus:dev spec
5655
docker run --rm -v $(pwd)/secrets:/secrets airbyte/destination-timeplus:dev check --config /secrets/config.json
57-
docker run --rm -v $(pwd)/secrets:/secrets airbyte/destination-timeplus:dev discover --config /secrets/config.json
58-
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/destination-timeplus:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
56+
cat integration_tests/messages.jsonl | docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/destination-timeplus:dev write --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
5957
```
6058

6159
### Running our CI test suite
@@ -69,7 +67,7 @@ Customize `acceptance-test-config.yml` file to configure acceptance tests. See [
6967
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
7068

7169
### Dependency Management
72-
All of your dependencies should be managed via Poetry.
70+
All of your dependencies should be managed via Poetry.
7371
To add a new dependency, run:
7472
```bash
7573
poetry add <package-name>
@@ -80,12 +78,12 @@ Please commit the changes to `pyproject.toml` and `poetry.lock` files.
8078
## Publishing a new version of the connector
8179
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
8280
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=destination-timeplus test`
83-
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
81+
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
8482
- bump the `dockerImageTag` value in in `metadata.yaml`
8583
- bump the `version` value in `pyproject.toml`
8684
3. Make sure the `metadata.yaml` content is up to date.
8785
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/destinations/timeplus.md`).
8886
5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
8987
6. Pat yourself on the back for being an awesome contributor.
9088
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
91-
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
89+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.

airbyte-integrations/connectors/destination-timeplus/destination_timeplus/destination.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ def type_mapping(v) -> str:
114114
if t != "null":
115115
type_def = {"type": t}
116116
if t == "array":
117-
type_def["items"] = v["items"]
117+
if "items" in v:
118+
type_def["items"] = v["items"]
119+
else:
120+
type_def["type"] = "string"
118121
return DestinationTimeplus.type_mapping(type_def)
119122
if airbyte_type == "number":
120123
return "float"
@@ -144,8 +147,6 @@ def check(self, logger: logging.Logger, config: Mapping[str, Any]) -> AirbyteCon
144147
try:
145148
endpoint = config["endpoint"]
146149
apikey = config["apikey"]
147-
if not endpoint.startswith("http"):
148-
return AirbyteConnectionStatus(status=Status.FAILED, message="Endpoint must start with http or https")
149150
if len(apikey) != 60:
150151
return AirbyteConnectionStatus(status=Status.FAILED, message="API Key must be 60 characters")
151152
if endpoint[-1] == "/":
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
3+
#
4+
5+
6+
import sys
7+
8+
from airbyte_cdk.entrypoint import launch
9+
from destination_timeplus import DestinationTimeplus
10+
11+
12+
def run():
13+
destination = DestinationTimeplus()
14+
destination.run(sys.argv[1:])

airbyte-integrations/connectors/destination-timeplus/destination_timeplus/spec.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"title": "Endpoint",
1616
"description": "Timeplus workspace endpoint",
1717
"type": "string",
18-
"default": "https://us.timeplus.cloud/<workspace_id>",
19-
"examples": ["https://us.timeplus.cloud/workspace_id"],
18+
"default": "https://us-west-2.timeplus.cloud/<workspace_id>",
19+
"examples": ["https://us-west-2.timeplus.cloud/workspace_id"],
2020
"order": 0
2121
},
2222
"apikey": {

airbyte-integrations/connectors/destination-timeplus/metadata.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ data:
22
connectorSubtype: database
33
connectorType: destination
44
definitionId: f70a8ece-351e-4790-b37b-cb790bcd6d54
5-
dockerImageTag: 0.1.19
5+
dockerImageTag: 0.1.20
66
dockerRepository: airbyte/destination-timeplus
77
githubIssueLabel: destination-timeplus
88
icon: timeplus.svg
99
license: MIT
1010
name: Timeplus
1111
registryOverrides:
1212
cloud:
13-
enabled: false
13+
enabled: true
1414
oss:
15-
enabled: false
15+
enabled: true
1616
releaseStage: alpha
1717
documentationUrl: https://docs.airbyte.com/integrations/destinations/timeplus
1818
tags:

0 commit comments

Comments
 (0)