mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-26 23:55:02 +00:00
MINOR: dbt migration fix (#23980)
* fix: migration * fix: playwright test DBT -> dbt
This commit is contained in:
parent
b5866df8bd
commit
30d0b0c04a
@ -6,15 +6,3 @@ SET json = JSON_ARRAY_INSERT(
|
||||
)
|
||||
WHERE JSON_CONTAINS(json->'$.supportedDataTypes', '"NUMBER"')
|
||||
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');
|
||||
@ -6,16 +6,4 @@ SET json = jsonb_set(
|
||||
true
|
||||
)
|
||||
WHERE json->'supportedDataTypes' @> '"NUMBER"'::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;
|
||||
AND NOT (json->'supportedDataTypes' @> '"NUMERIC"'::jsonb);
|
||||
@ -0,0 +1,11 @@
|
||||
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');
|
||||
@ -0,0 +1,11 @@
|
||||
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;
|
||||
@ -33,19 +33,24 @@ public class MigrationUtil {
|
||||
}
|
||||
offset += pageSize;
|
||||
for (String json : jsons) {
|
||||
TestCase testCase = JsonUtils.readValue(json, TestCase.class);
|
||||
TestDefinition td = getTestDefinition(daoCollection, testCase);
|
||||
if (Objects.nonNull(td) && Objects.equals(td.getName(), TABLE_DIFF)) {
|
||||
LOG.debug("Adding caseSensitiveColumns=true table diff test case: {}", testCase.getId());
|
||||
if (!hasCaseSensitiveColumnsParam(testCase.getParameterValues())) {
|
||||
testCase
|
||||
.getParameterValues()
|
||||
.add(
|
||||
new TestCaseParameterValue()
|
||||
.withName("caseSensitiveColumns")
|
||||
.withValue("true"));
|
||||
try {
|
||||
TestCase testCase = JsonUtils.readValue(json, TestCase.class);
|
||||
TestDefinition td = getTestDefinition(daoCollection, testCase);
|
||||
if (Objects.nonNull(td) && Objects.equals(td.getName(), TABLE_DIFF)) {
|
||||
LOG.debug(
|
||||
"Adding caseSensitiveColumns=true table diff test case: {}", testCase.getId());
|
||||
if (!hasCaseSensitiveColumnsParam(testCase.getParameterValues())) {
|
||||
testCase
|
||||
.getParameterValues()
|
||||
.add(
|
||||
new TestCaseParameterValue()
|
||||
.withName("caseSensitiveColumns")
|
||||
.withValue("true"));
|
||||
}
|
||||
daoCollection.testCaseDAO().update(testCase);
|
||||
}
|
||||
daoCollection.testCaseDAO().update(testCase);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error migrating test definition: ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1185,7 +1185,7 @@ test('TestCase filters', PLAYWRIGHT_INGESTION_TAG_OBJ, async ({ page }) => {
|
||||
|
||||
// Test case filter by platform
|
||||
const testCasePlatformByDBT = page.waitForResponse(
|
||||
`/api/v1/dataQuality/testCases/search/list?*testPlatforms=DBT*`
|
||||
`/api/v1/dataQuality/testCases/search/list?*testPlatforms=dbt*`
|
||||
);
|
||||
await page.getByTestId('platform-select-filter').click();
|
||||
await page.getByTitle('DBT').click();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user