From 17ffdf98507ee838bb5f3b9c2509ce0be47a391b Mon Sep 17 00:00:00 2001 From: Ayush Shah Date: Fri, 22 Nov 2024 09:33:50 +0530 Subject: [PATCH 1/2] fix: modify fqn to allow quotes with dots (#18719) --- .../looker/dashboardDataModels.json | 45 ------------------- .../ingestion/source/database/sample_data.py | 15 +++++-- ingestion/tests/unit/test_fqn.py | 1 + .../antlr4/org/openmetadata/schema/Fqn.g4 | 4 +- 4 files changed, 14 insertions(+), 51 deletions(-) diff --git a/ingestion/examples/sample_data/looker/dashboardDataModels.json b/ingestion/examples/sample_data/looker/dashboardDataModels.json index 2bdd0b68961d..1d30232b86bd 100644 --- a/ingestion/examples/sample_data/looker/dashboardDataModels.json +++ b/ingestion/examples/sample_data/looker/dashboardDataModels.json @@ -158,51 +158,6 @@ "ordinalPosition": 5 } ] - }, - { - "name": "\"orders_view\" || \"operations_view\"", - "displayName": "Orders View and Operations View", - "description": "Orders View and Operations View from Sample Data", - "dataModelType": "LookMlView", - "serviceType": "Looker", - "sql": "view: orders {\n sql_table_name: orders ;;\n\n dimension: \"1. Phase I\" {\n type: string\n sql: ${TABLE}.status ;;\n }\n\n dimension: \"4. Authorized\" {\n type: int\n sql: ${TABLE}.amount ;;\n }\n}", - "columns": [ - { - "name": "0. Pre-clinical", - "dataType": "NUMERIC", - "dataTypeDisplay": "numeric", - "description": "Vaccine Candidates in phase: 'Pre-clinical'", - "ordinalPosition": 1 - }, - { - "name": "2. Phase II or Combined I/II", - "dataType": "NUMERIC", - "dataTypeDisplay": "numeric", - "description": "Vaccine Candidates in phase: 'Phase II or Combined I/II'", - "ordinalPosition": 2 - }, - { - "name": "1. Phase I", - "dataType": "NUMERIC", - "dataTypeDisplay": "numeric", - "description": "Vaccine Candidates in phase: 'Phase I'", - "ordinalPosition": 3 - }, - { - "name": "3. Phase III", - "dataType": "NUMERIC", - "dataTypeDisplay": "numeric", - "description": "Vaccine Candidates in phase: 'Phase III'", - "ordinalPosition": 4 - }, - { - "name": "4. Authorized", - "dataType": "NUMERIC", - "dataTypeDisplay": "numeric", - "description": "Vaccine Candidates in phase: 'Authorize'", - "ordinalPosition": 5 - } - ] } ] diff --git a/ingestion/src/metadata/ingestion/source/database/sample_data.py b/ingestion/src/metadata/ingestion/source/database/sample_data.py index b4d6246bad53..f809f045206b 100644 --- a/ingestion/src/metadata/ingestion/source/database/sample_data.py +++ b/ingestion/src/metadata/ingestion/source/database/sample_data.py @@ -136,6 +136,7 @@ InvalidSchemaTypeException, schema_parser_config_registry, ) +from metadata.sampler.models import SampleData, SamplerResponse from metadata.utils import entity_link, fqn from metadata.utils.constants import UTF_8 from metadata.utils.fqn import FQN_SEPARATOR @@ -898,10 +899,16 @@ def ingest_tables(self) -> Iterable[Either[Entity]]: self.metadata.ingest_table_sample_data( table_entity, - TableData( - rows=table["sampleData"]["rows"], - columns=table["sampleData"]["columns"], - ), + sample_data=SamplerResponse( + table=table_entity, + sample_data=SampleData( + data=TableData( + rows=table["sampleData"]["rows"], + columns=table["sampleData"]["columns"], + ), + store=True, + ), + ).sample_data.data, ) if table.get("customMetrics"): diff --git a/ingestion/tests/unit/test_fqn.py b/ingestion/tests/unit/test_fqn.py index 1dfb448c57d2..eac462b2144f 100644 --- a/ingestion/tests/unit/test_fqn.py +++ b/ingestion/tests/unit/test_fqn.py @@ -58,6 +58,7 @@ def validate(self, actual_parts, actual_fqn): FQNTest(["a.1", "b.2", "c", "d"], '"a.1"."b.2".c.d'), FQNTest(["a.1", "b.2", "c.3", "d"], '"a.1"."b.2"."c.3".d'), FQNTest(["a.1", "b.2", "c.3", "d.4"], '"a.1"."b.2"."c.3"."d.4"'), + FQNTest(["fqn", "test.test.test"], 'fqn."test.test.test"'), ] for x in xs: x.validate(fqn.split(x.fqn), fqn._build(*x.parts)) diff --git a/openmetadata-spec/src/main/antlr4/org/openmetadata/schema/Fqn.g4 b/openmetadata-spec/src/main/antlr4/org/openmetadata/schema/Fqn.g4 index e7ac76fb95a2..2aad7c487ef8 100644 --- a/openmetadata-spec/src/main/antlr4/org/openmetadata/schema/Fqn.g4 +++ b/openmetadata-spec/src/main/antlr4/org/openmetadata/schema/Fqn.g4 @@ -14,7 +14,7 @@ NAME ; NAME_WITH_RESERVED - : QUOTE NON_RESERVED* (RESERVED)* NON_RESERVED* QUOTE + : QUOTE NON_RESERVED* (RESERVED NON_RESERVED*)+ QUOTE ; QUOTE @@ -22,7 +22,7 @@ QUOTE ; NON_RESERVED - : ~[.] + : ~[".] ; RESERVED From 23a52934ab77139333e296b1622cdcfd5ed616d1 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Fri, 22 Nov 2024 10:35:47 +0530 Subject: [PATCH 2/2] fix the switch placement and added beta tag (#18726) --- .../PageHeader/PageHeader.component.tsx | 15 ++++++- .../PageHeader/PageHeader.interface.ts | 1 + .../SearchRBACSettingsPage.tsx | 45 +++++++++---------- .../src/main/resources/ui/src/styles/app.less | 14 ++++++ .../main/resources/ui/src/styles/spacing.less | 3 ++ 5 files changed, 52 insertions(+), 26 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/PageHeader/PageHeader.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/PageHeader/PageHeader.component.tsx index f39696c2ff98..0b311b05322e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/PageHeader/PageHeader.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/PageHeader/PageHeader.component.tsx @@ -11,8 +11,9 @@ * limitations under the License. */ -import { Typography } from 'antd'; +import { Badge, Typography } from 'antd'; import React from 'react'; +import { useTranslation } from 'react-i18next'; import './page-header.less'; import { HeaderProps } from './PageHeader.interface'; @@ -20,7 +21,10 @@ const PageHeader = ({ data: { header, subHeader }, titleProps, subHeaderProps, + isBeta, }: HeaderProps) => { + const { t } = useTranslation(); + return (
{header} + + {isBeta && ( + + )} { - + - - - - - {t('label.enable-roles-polices-in-search')} - - - - - - - + + {t('label.enable-roles-polices-in-search')} + + - - + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/app.less b/openmetadata-ui/src/main/resources/ui/src/styles/app.less index 8fc1c0141785..7939f76e97d3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/app.less +++ b/openmetadata-ui/src/main/resources/ui/src/styles/app.less @@ -557,6 +557,20 @@ a[href].link-text-grey, } } +// beta tag for page header +.service-beta-page-header { + sup { + height: auto; + padding: 2px 6px; + border-radius: 30px; + margin-left: 2px; + font-size: 10px; + background: @primary-1; + border: 1px solid @primary-color; + color: @primary-color; + } +} + /* Tabs */ .ant-tabs-top > .ant-tabs-nav::before { border-color: @border-color; diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/spacing.less b/openmetadata-ui/src/main/resources/ui/src/styles/spacing.less index 44684a130966..108a1cdef543 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/spacing.less +++ b/openmetadata-ui/src/main/resources/ui/src/styles/spacing.less @@ -155,6 +155,9 @@ .m-l-lg { margin-left: @margin-lg; } +.m-l-xlg { + margin-left: @margin-xlg; +} .m-l-auto { margin-left: auto; }