Skip to content

Commit eba7648

Browse files
author
Ilyas Gasanov
committed
[DOP-19896] Add Clickhouse API schema
1 parent 6fa1625 commit eba7648

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

syncmaster/backend/api/v1/connections.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from syncmaster.exceptions.credentials import AuthDataNotFoundError
1919
from syncmaster.exceptions.group import GroupNotFoundError
2020
from syncmaster.schemas.v1.connection_types import (
21+
CLICKHOUSE_TYPE,
2122
HDFS_TYPE,
2223
HIVE_TYPE,
2324
ORACLE_TYPE,
@@ -37,7 +38,7 @@
3738

3839
router = APIRouter(tags=["Connections"], responses=get_error_responses())
3940

40-
CONNECTION_TYPES = ORACLE_TYPE, POSTGRES_TYPE, HIVE_TYPE, S3_TYPE, HDFS_TYPE
41+
CONNECTION_TYPES = ORACLE_TYPE, POSTGRES_TYPE, CLICKHOUSE_TYPE, HIVE_TYPE, S3_TYPE, HDFS_TYPE
4142

4243

4344
@router.get("/connections")

tests/test_unit/test_connections/test_create_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ async def test_check_fields_validation_on_create_connection(
282282
"context": {
283283
"discriminator": "'type'",
284284
"tag": "POSTGRESQL",
285-
"expected_tags": "'hive', 'oracle', 'postgres', 'hdfs', 's3'",
285+
"expected_tags": "'hive', 'oracle', 'postgres', 'clickhouse', 'hdfs', 's3'",
286286
},
287287
"input": {
288288
"type": "POSTGRESQL",
@@ -292,7 +292,7 @@ async def test_check_fields_validation_on_create_connection(
292292
"database_name": "postgres",
293293
},
294294
"location": ["body", "connection_data"],
295-
"message": "Input tag 'POSTGRESQL' found using 'type' does not match any of the expected tags: 'hive', 'oracle', 'postgres', 'hdfs', 's3'",
295+
"message": "Input tag 'POSTGRESQL' found using 'type' does not match any of the expected tags: 'hive', 'oracle', 'postgres', 'clickhouse', 'hdfs', 's3'",
296296
"code": "union_tag_invalid",
297297
},
298298
],

tests/test_unit/test_transfers/transfer_fixtures/transfers_fixture.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ async def group_transfers(
7676
source_params["directory_path"] = "/path/to/source"
7777
target_params.update(common_params)
7878
target_params["directory_path"] = "/path/to/target"
79-
elif connection_type in [ConnectionType.HIVE, ConnectionType.POSTGRES, ConnectionType.ORACLE]:
79+
elif connection_type in [
80+
ConnectionType.HIVE,
81+
ConnectionType.POSTGRES,
82+
ConnectionType.ORACLE,
83+
ConnectionType.CLICKHOUSE,
84+
]:
8085
source_params["table_name"] = "source_table"
8186
target_params["table_name"] = "target_table"
8287

0 commit comments

Comments
 (0)