Skip to content

Commit

Permalink
✨ Destination Timeplus: fix issues in README and upgrade timeplus and…
Browse files Browse the repository at this point in the history
… cdk (#44758)

Co-authored-by: Marcos Marx <[email protected]>
  • Loading branch information
jovezhong and marcosmarxm authored Sep 8, 2024
1 parent e24fcd7 commit 06f8a2b
Show file tree
Hide file tree
Showing 8 changed files with 681 additions and 65 deletions.
16 changes: 7 additions & 9 deletions airbyte-integrations/connectors/destination-timeplus/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Timeplus source connector
# Timeplus destination connector


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

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


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

### Running unit tests
Expand All @@ -54,8 +53,7 @@ Then run any of the connector commands as follows:
```
docker run --rm airbyte/destination-timeplus:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/destination-timeplus:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/destination-timeplus:dev discover --config /secrets/config.json
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
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
```

### Running our CI test suite
Expand All @@ -69,7 +67,7 @@ Customize `acceptance-test-config.yml` file to configure acceptance tests. See [
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.

### Dependency Management
All of your dependencies should be managed via Poetry.
All of your dependencies should be managed via Poetry.
To add a new dependency, run:
```bash
poetry add <package-name>
Expand All @@ -80,12 +78,12 @@ Please commit the changes to `pyproject.toml` and `poetry.lock` files.
## Publishing a new version of the connector
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=destination-timeplus test`
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)):
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)):
- bump the `dockerImageTag` value in in `metadata.yaml`
- bump the `version` value in `pyproject.toml`
3. Make sure the `metadata.yaml` content is up to date.
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/destinations/timeplus.md`).
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).
6. Pat yourself on the back for being an awesome contributor.
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ def type_mapping(v) -> str:
if t != "null":
type_def = {"type": t}
if t == "array":
type_def["items"] = v["items"]
if "items" in v:
type_def["items"] = v["items"]
else:
type_def["type"] = "string"
return DestinationTimeplus.type_mapping(type_def)
if airbyte_type == "number":
return "float"
Expand Down Expand Up @@ -144,8 +147,6 @@ def check(self, logger: logging.Logger, config: Mapping[str, Any]) -> AirbyteCon
try:
endpoint = config["endpoint"]
apikey = config["apikey"]
if not endpoint.startswith("http"):
return AirbyteConnectionStatus(status=Status.FAILED, message="Endpoint must start with http or https")
if len(apikey) != 60:
return AirbyteConnectionStatus(status=Status.FAILED, message="API Key must be 60 characters")
if endpoint[-1] == "/":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#


import sys

from airbyte_cdk.entrypoint import launch
from destination_timeplus import DestinationTimeplus


def run():
destination = DestinationTimeplus()
destination.run(sys.argv[1:])
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"title": "Endpoint",
"description": "Timeplus workspace endpoint",
"type": "string",
"default": "https://us.timeplus.cloud/<workspace_id>",
"examples": ["https://us.timeplus.cloud/workspace_id"],
"default": "https://us-west-2.timeplus.cloud/<workspace_id>",
"examples": ["https://us-west-2.timeplus.cloud/workspace_id"],
"order": 0
},
"apikey": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: f70a8ece-351e-4790-b37b-cb790bcd6d54
dockerImageTag: 0.1.19
dockerImageTag: 0.1.20
dockerRepository: airbyte/destination-timeplus
githubIssueLabel: destination-timeplus
icon: timeplus.svg
license: MIT
name: Timeplus
registryOverrides:
cloud:
enabled: false
enabled: true
oss:
enabled: false
enabled: true
releaseStage: alpha
documentationUrl: https://docs.airbyte.com/integrations/destinations/timeplus
tags:
Expand Down
Loading

0 comments on commit 06f8a2b

Please sign in to comment.