Skip to content

Commit

Permalink
Merge branch 'main' into fix-mstr-api
Browse files Browse the repository at this point in the history
  • Loading branch information
SumanMaharana authored Nov 22, 2024
2 parents 0da4b19 + 23a5293 commit d8925a9
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 77 deletions.
45 changes: 0 additions & 45 deletions ingestion/examples/sample_data/looker/dashboardDataModels.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
]

15 changes: 11 additions & 4 deletions ingestion/src/metadata/ingestion/source/database/sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"):
Expand Down
1 change: 1 addition & 0 deletions ingestion/tests/unit/test_fqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ NAME
;

NAME_WITH_RESERVED
: QUOTE NON_RESERVED* (RESERVED)* NON_RESERVED* QUOTE
: QUOTE NON_RESERVED* (RESERVED NON_RESERVED*)+ QUOTE
;

QUOTE
: '"'
;

NON_RESERVED
: ~[.]
: ~[".]
;
RESERVED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
* 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';

const PageHeader = ({
data: { header, subHeader },
titleProps,
subHeaderProps,
isBeta,
}: HeaderProps) => {
const { t } = useTranslation();

return (
<div className="page-header-container" data-testid="page-header-container">
<Typography.Title
Expand All @@ -29,6 +33,15 @@ const PageHeader = ({
level={5}
{...titleProps}>
{header}

{isBeta && (
<Badge
className="service-beta-page-header m-l-sm"
count={t('label.beta')}
data-testid="beta-badge"
size="small"
/>
)}
</Typography.Title>
<Typography.Paragraph
className="sub-heading"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ export interface HeaderProps {
};
titleProps?: TypographyProps;
subHeaderProps?: ParagraphProps;
isBeta?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,30 @@ const SearchRBACSettingsPage = () => {
<Col span={24}>
<Row align="middle" justify="space-between">
<Col>
<PageHeader data={PAGE_HEADERS.SEARCH_RBAC} />
<PageHeader isBeta data={PAGE_HEADERS.SEARCH_RBAC} />
</Col>
</Row>
</Col>
<Col span={12}>
<Row align="middle">
<Col span={24}>
<Typography.Text className="m-0 text-grey-muted">
{t('label.enable-roles-polices-in-search')}
<Tooltip
placement="top"
title={t('message.enable-access-control-description')}
trigger="hover">
<InfoCircleOutlined
className="m-x-xss"
data-testid="enable-access-control-info"
style={{ color: GRAYED_OUT_COLOR }}
/>
</Tooltip>
</Typography.Text>
</Col>
<Col>
<Switch
checked={searchConfig?.enableAccessControl}
disabled={isUpdating}
onChange={handleUpdateClick}
<Col className="d-flex items-center" span={12}>
<Typography.Text className="m-0 text-grey-muted">
{t('label.enable-roles-polices-in-search')}
<Tooltip
placement="top"
title={t('message.enable-access-control-description')}
trigger="hover">
<InfoCircleOutlined
className="m-x-xss"
data-testid="enable-access-control-info"
style={{ color: GRAYED_OUT_COLOR }}
/>
</Col>
</Row>
</Tooltip>
</Typography.Text>
<Switch
checked={searchConfig?.enableAccessControl}
className="m-l-xlg"
disabled={isUpdating}
onChange={handleUpdateClick}
/>
</Col>
</Row>
</PageLayoutV1>
Expand Down
14 changes: 14 additions & 0 deletions openmetadata-ui/src/main/resources/ui/src/styles/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions openmetadata-ui/src/main/resources/ui/src/styles/spacing.less
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@
.m-l-lg {
margin-left: @margin-lg;
}
.m-l-xlg {
margin-left: @margin-xlg;
}
.m-l-auto {
margin-left: auto;
}
Expand Down

0 comments on commit d8925a9

Please sign in to comment.