mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-06-27 04:22:05 +00:00
Fixes: Databricks httpPath Required (#20611)
* fix: made databricks httpPath required and added a migration file for the same * fix: added sql migration in postDataMigration file and fix databricks tests * fix: added httpPath in test_source_connection.py and test_source_parsing.py files * fix: added httpPath in test_databricks_lineage.py * fix: table name in postgres migration
This commit is contained in:
parent
d10bccceca
commit
0796c6274b
@ -1,3 +1,17 @@
|
|||||||
UPDATE test_case
|
UPDATE test_case
|
||||||
SET json = json_set(json, '$.createdBy', json->>'$.updatedBy')
|
SET json = json_set(json, '$.createdBy', json->>'$.updatedBy')
|
||||||
WHERE json->>'$.createdBy' IS NULL;
|
WHERE json->>'$.createdBy' IS NULL;
|
||||||
|
|
||||||
|
-- Made httpPath a required field for Databricks, updating records
|
||||||
|
-- where httpPath is NULL or missing to an empty string.
|
||||||
|
UPDATE
|
||||||
|
dbservice_entity
|
||||||
|
SET
|
||||||
|
json = JSON_SET(json, '$.connection.config.httpPath', '')
|
||||||
|
WHERE
|
||||||
|
serviceType = 'Databricks'
|
||||||
|
AND (
|
||||||
|
JSON_CONTAINS_PATH(json, 'one', '$.connection.config.httpPath') = 0
|
||||||
|
OR JSON_UNQUOTE(json ->> '$.connection.config.httpPath') IS NULL
|
||||||
|
OR json ->> '$.connection.config.httpPath' = 'null'
|
||||||
|
);
|
@ -1,3 +1,23 @@
|
|||||||
UPDATE test_case
|
UPDATE test_case
|
||||||
SET json = json || jsonb_build_object('createdBy', json->>'updatedBy')
|
SET json = json || jsonb_build_object('createdBy', json->>'updatedBy')
|
||||||
WHERE json->>'createdBy' IS NULL;
|
WHERE json->>'createdBy' IS NULL;
|
||||||
|
|
||||||
|
-- Made httpPath a required field for Databricks, updating records
|
||||||
|
-- where httpPath is NULL or missing to an empty string.
|
||||||
|
UPDATE
|
||||||
|
dbservice_entity
|
||||||
|
SET
|
||||||
|
json = jsonb_set(
|
||||||
|
json,
|
||||||
|
'{connection,config,httpPath}',
|
||||||
|
'""' :: jsonb,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
WHERE
|
||||||
|
serviceType = 'Databricks'
|
||||||
|
AND (
|
||||||
|
NOT jsonb_path_exists(json, '$.connection.config.httpPath')
|
||||||
|
OR (json -> 'connection' -> 'config' ->> 'httpPath') IS NULL
|
||||||
|
OR (json -> 'connection' -> 'config' ->> 'httpPath') = 'null'
|
||||||
|
);
|
||||||
|
|
@ -87,6 +87,7 @@ mock_databricks_config = {
|
|||||||
"config": {
|
"config": {
|
||||||
"token": "random_token",
|
"token": "random_token",
|
||||||
"hostPort": "localhost:443",
|
"hostPort": "localhost:443",
|
||||||
|
"httpPath": "sql/1.0/endpoints/path",
|
||||||
"connectionArguments": {
|
"connectionArguments": {
|
||||||
"http_path": "sql/1.0/endpoints/path",
|
"http_path": "sql/1.0/endpoints/path",
|
||||||
},
|
},
|
||||||
|
@ -129,6 +129,7 @@ class SourceConnectionTest(TestCase):
|
|||||||
scheme=DatabricksScheme.databricks_connector,
|
scheme=DatabricksScheme.databricks_connector,
|
||||||
hostPort="1.1.1.1:443",
|
hostPort="1.1.1.1:443",
|
||||||
token="KlivDTACWXKmZVfN1qIM",
|
token="KlivDTACWXKmZVfN1qIM",
|
||||||
|
httpPath="/sql/1.0/warehouses/abcdedfg",
|
||||||
)
|
)
|
||||||
assert expected_result == get_connection_url(databricks_conn_obj)
|
assert expected_result == get_connection_url(databricks_conn_obj)
|
||||||
|
|
||||||
@ -144,6 +145,7 @@ class SourceConnectionTest(TestCase):
|
|||||||
scheme=DatabricksScheme.databricks_connector,
|
scheme=DatabricksScheme.databricks_connector,
|
||||||
hostPort="1.1.1.1:443",
|
hostPort="1.1.1.1:443",
|
||||||
token="KlivDTACWXKmZVfN1qIM",
|
token="KlivDTACWXKmZVfN1qIM",
|
||||||
|
httpPath="/sql/1.0/warehouses/abcdedfg",
|
||||||
)
|
)
|
||||||
assert expected_result == get_connection_url(databricks_conn_obj)
|
assert expected_result == get_connection_url(databricks_conn_obj)
|
||||||
|
|
||||||
|
@ -237,6 +237,7 @@ def test_databricks():
|
|||||||
"config": {
|
"config": {
|
||||||
"token": "<databricks token>",
|
"token": "<databricks token>",
|
||||||
"hostPort": "localhost:443",
|
"hostPort": "localhost:443",
|
||||||
|
"httpPath": "<http path of databricks cluster>",
|
||||||
"connectionArguments": {
|
"connectionArguments": {
|
||||||
"http_path": "<http path of databricks cluster>"
|
"http_path": "<http path of databricks cluster>"
|
||||||
},
|
},
|
||||||
|
@ -48,6 +48,7 @@ mock_databricks_config = {
|
|||||||
"databaseSchema": "default",
|
"databaseSchema": "default",
|
||||||
"token": "123sawdtesttoken",
|
"token": "123sawdtesttoken",
|
||||||
"hostPort": "localhost:443",
|
"hostPort": "localhost:443",
|
||||||
|
"httpPath": "/sql/1.0/warehouses/abcdedfg",
|
||||||
"connectionArguments": {"http_path": "/sql/1.0/warehouses/abcdedfg"},
|
"connectionArguments": {"http_path": "/sql/1.0/warehouses/abcdedfg"},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -9,13 +9,17 @@
|
|||||||
"databricksType": {
|
"databricksType": {
|
||||||
"description": "Service type.",
|
"description": "Service type.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["Databricks"],
|
"enum": [
|
||||||
|
"Databricks"
|
||||||
|
],
|
||||||
"default": "Databricks"
|
"default": "Databricks"
|
||||||
},
|
},
|
||||||
"databricksScheme": {
|
"databricksScheme": {
|
||||||
"description": "SQLAlchemy driver scheme options.",
|
"description": "SQLAlchemy driver scheme options.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["databricks+connector"],
|
"enum": [
|
||||||
|
"databricks+connector"
|
||||||
|
],
|
||||||
"default": "databricks+connector"
|
"default": "databricks+connector"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -84,7 +88,9 @@
|
|||||||
"$ref": "../../../../type/filterPattern.json#/definitions/filterPattern",
|
"$ref": "../../../../type/filterPattern.json#/definitions/filterPattern",
|
||||||
"default": {
|
"default": {
|
||||||
"includes": [],
|
"includes": [],
|
||||||
"excludes": ["^information_schema$"]
|
"excludes": [
|
||||||
|
"^information_schema$"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tableFilterPattern": {
|
"tableFilterPattern": {
|
||||||
@ -98,7 +104,9 @@
|
|||||||
"$ref": "../../../../type/filterPattern.json#/definitions/filterPattern",
|
"$ref": "../../../../type/filterPattern.json#/definitions/filterPattern",
|
||||||
"default": {
|
"default": {
|
||||||
"includes": [],
|
"includes": [],
|
||||||
"excludes": ["^system$"]
|
"excludes": [
|
||||||
|
"^system$"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"supportsUsageExtraction": {
|
"supportsUsageExtraction": {
|
||||||
@ -132,5 +140,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": ["hostPort", "token"]
|
"required": [
|
||||||
|
"hostPort",
|
||||||
|
"token",
|
||||||
|
"httpPath"
|
||||||
|
]
|
||||||
}
|
}
|
@ -45,7 +45,7 @@ export interface DatabricksConnection {
|
|||||||
/**
|
/**
|
||||||
* Databricks compute resources URL.
|
* Databricks compute resources URL.
|
||||||
*/
|
*/
|
||||||
httpPath?: string;
|
httpPath: string;
|
||||||
/**
|
/**
|
||||||
* Table name to fetch the query history.
|
* Table name to fetch the query history.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user