Skip to content

Commit

Permalink
✨ Destination Typesense: Added support for path config option (#36460)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
  • Loading branch information
3 people authored Mar 27, 2024
1 parent a4064d5 commit 15eeaba
Show file tree
Hide file tree
Showing 8 changed files with 1,094 additions and 68 deletions.
38 changes: 0 additions & 38 deletions airbyte-integrations/connectors/destination-typesense/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#


import time
from typing import Any, Iterable, Mapping

from airbyte_cdk import AirbyteLogger
Expand All @@ -13,12 +14,11 @@


def get_client(config: Mapping[str, Any]) -> Client:
api_key = config.get("api_key")
host = config.get("host")
port = config.get("port") or "8108"
protocol = config.get("protocol") or "https"

client = Client({"api_key": api_key, "nodes": [{"host": host, "port": port, "protocol": protocol}], "connection_timeout_seconds": 3600})
node = {"host": config.get("host"), "port": config.get("port") or "8108", "protocol": config.get("protocol") or "https"}
path = config.get("path")
if path:
node["path"] = path
client = Client({"api_key": config.get("api_key"), "nodes": [node], "connection_timeout_seconds": 3600})

return client

Expand Down Expand Up @@ -56,6 +56,7 @@ def check(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> AirbyteConn
client = get_client(config=config)
client.collections.create({"name": "_airbyte", "fields": [{"name": "title", "type": "string"}]})
client.collections["_airbyte"].documents.create({"id": "1", "title": "The Hunger Games"})
time.sleep(3)
client.collections["_airbyte"].documents["1"].retrieve()
client.collections["_airbyte"].delete()
return AirbyteConnectionStatus(status=Status.SUCCEEDED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
"type": "integer",
"description": "How many documents should be imported together. Default 1000",
"order": 4
},
"path": {
"title": "Path",
"type": "string",
"description": "Path of the Typesense instance. Default is none",
"order": 5
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: 36be8dc6-9851-49af-b776-9d4c30e4ab6a
dockerImageTag: 0.1.3
dockerImageTag: 0.1.4
dockerRepository: airbyte/destination-typesense
connectorBuildOptions:
baseImage: docker.io/airbyte/python-connector-base:1.1.0@sha256:bd98f6505c6764b1b5f99d3aedc23dfc9e9af631a62533f60eb32b1d3dbab20c
githubIssueLabel: destination-typesense
icon: typesense.svg
license: MIT
Expand Down
1,045 changes: 1,045 additions & 0 deletions airbyte-integrations/connectors/destination-typesense/poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.1.4"
name = "destination-typesense"
description = "Destination Implementation for Typesense."
authors = [ "Airbyte <contact@airbyte.io>",]
license = "MIT"
readme = "README.md"
documentation = "https://docs.airbyte.com/integrations/destination/typesense"
homepage = "https://airbyte.com"
repository = "https://github.com/airbytehq/airbyte"
[[tool.poetry.packages]]
include = "destination_typesense"

[tool.poetry.dependencies]
python = "^3.9,<3.12"
airbyte-cdk = "==0.74.0"
typesense = "^0.14.0"


[tool.poetry.scripts]
destination-typesense = "destination_typesense.run:run"

[tool.poetry.group.dev.dependencies]
requests-mock = "^1.9.3"
typesense = "^0.14.0"
pytest-mock = "^3.6.1"
pytest = "^6.1"

23 changes: 0 additions & 23 deletions airbyte-integrations/connectors/destination-typesense/setup.py

This file was deleted.

1 change: 1 addition & 0 deletions docs/integrations/destinations/typesense.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The setup only requires two fields. First is the `host` which is the address at

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :---------------------------- |
| 0.1.4 | 2024-03-25 | [36460](https://github.com/airbytehq/airbyte/pull/36460) | Added path config option |
| 0.1.3 | 2024-01-17 | [34336](https://github.com/airbytehq/airbyte/pull/34336) | Fix check() arguments error |
| 0.1.2 | 2023-08-25 | [29817](https://github.com/airbytehq/airbyte/pull/29817) | Fix writing multiple streams |
| 0.1.1 | 2023-08-24 | [29555](https://github.com/airbytehq/airbyte/pull/29555) | Increasing connection timeout |
Expand Down

0 comments on commit 15eeaba

Please sign in to comment.