MINOR: Fix uppercase DBT to lowercase dbt (#23900)

* fix: uppercase DBT to lowercase dbt

* fix: change DBT to lowercase dbt in TestPlatform enum

* fix: fix dbt syntax in valueMax

---------

Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
This commit is contained in:
Teddy 2025-10-21 07:59:09 +02:00 committed by GitHub
parent 7b162d7440
commit e103a8c805
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 32 additions and 8 deletions

View File

@ -5,4 +5,16 @@ SET json = JSON_ARRAY_INSERT(
'NUMERIC'
)
WHERE JSON_CONTAINS(json->'$.supportedDataTypes', '"NUMBER"')
AND NOT JSON_CONTAINS(json->'$.supportedDataTypes', '"NUMERIC"');
AND NOT JSON_CONTAINS(json->'$.supportedDataTypes', '"NUMERIC"');
UPDATE test_definition
SET json = JSON_SET(
json,
'$.testPlatforms',
CAST(REPLACE(
JSON_EXTRACT(json, '$.testPlatforms'),
'"DBT"',
'"dbt"'
) AS JSON)
)
WHERE JSON_CONTAINS(json, '"DBT"', '$.testPlatforms');

View File

@ -6,4 +6,16 @@ SET json = jsonb_set(
true
)
WHERE json->'supportedDataTypes' @> '"NUMBER"'::jsonb
AND NOT (json->'supportedDataTypes' @> '"NUMERIC"'::jsonb);
AND NOT (json->'supportedDataTypes' @> '"NUMERIC"'::jsonb);
UPDATE test_definition
SET json = jsonb_set(
json::jsonb,
'{testPlatforms}',
REPLACE(
(json::jsonb -> 'testPlatforms')::text,
'"DBT"',
'"dbt"'
)::jsonb
)::json
WHERE json::jsonb -> 'testPlatforms' @> '"DBT"'::jsonb;

View File

@ -1151,7 +1151,7 @@ class DbtSource(DbtServiceSource):
name=manifest_node.name,
description=manifest_node.description,
entityType=entity_type,
testPlatforms=[TestPlatform.DBT],
testPlatforms=[TestPlatform.dbt],
parameterDefinition=create_test_case_parameter_definitions(
manifest_node
),

View File

@ -69,7 +69,7 @@ class CliDBTBase(TestCase):
def test_dbt_test_cases(self) -> None:
test_case_entity_list = self.openmetadata.list_entities(
entity=TestDefinition,
params={"testPlatform": TestPlatform.DBT.value},
params={"testPlatform": TestPlatform.dbt.value},
)
self.assertTrue(len(test_case_entity_list.entities) == 26)

View File

@ -4,7 +4,7 @@
"displayName": "Column Value Max. To Be Between",
"description": "This schema defines the test ColumnValueMaxToBeBetween. Test the maximum value in a col is within a range.",
"entityType": "COLUMN",
"testPlatforms": ["OpenMetadata", "DBT"],
"testPlatforms": ["OpenMetadata", "dbt"],
"supportedDataTypes": ["NUMBER", "INT", "FLOAT", "DOUBLE", "DECIMAL", "TINYINT", "SMALLINT", "BIGINT", "BYTEINT"],
"parameterDefinition": [
{

View File

@ -14,7 +14,7 @@
"enum": [
"OpenMetadata",
"GreatExpectations",
"DBT",
"dbt",
"Deequ",
"Soda",
"Other"

View File

@ -295,7 +295,7 @@ export enum DataType {
* This schema defines the platform where tests are defined and ran.
*/
export enum TestPlatform {
Dbt = "DBT",
Dbt = "dbt",
Deequ = "Deequ",
GreatExpectations = "GreatExpectations",
OpenMetadata = "OpenMetadata",

View File

@ -422,7 +422,7 @@ export enum DataType {
* This schema defines the platform where tests are defined and ran.
*/
export enum TestPlatform {
Dbt = "DBT",
Dbt = "dbt",
Deequ = "Deequ",
GreatExpectations = "GreatExpectations",
OpenMetadata = "OpenMetadata",