Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-acryl committed Dec 19, 2024
2 parents 6def894 + 2e54461 commit bed1880
Show file tree
Hide file tree
Showing 204 changed files with 7,215 additions and 3,346 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/check-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches:
- master
paths:
- "metadata-integration"
- "metadata-integration/**"
pull_request:
branches:
- "**"
paths:
- "metadata-integration"
- "metadata-integration/**"
release:
types: [published]

Expand All @@ -28,15 +28,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: acryldata/sane-checkout-action@v3
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: actions/cache@v4
with:
path: |
~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('**/requirements.txt') }}
- name: Install dependencies
run: ./metadata-ingestion/scripts/install_deps.sh
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 17
- uses: gradle/actions/setup-gradle@v3
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: check ${{ matrix.command }} jar
run: |
./gradlew :metadata-integration:java:${{ matrix.command }}:build --info
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ configure(subprojects.findAll {! it.name.startsWith('spark-lineage')}) {
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.slf4j", module: "slf4j-nop"
exclude group: "org.slf4j", module: "slf4j-ext"
exclude group: "org.codehaus.jackson", module: "jackson-mapper-asl"

resolutionStrategy.force externalDependency.antlr4Runtime
resolutionStrategy.force externalDependency.antlr4
Expand Down
2 changes: 2 additions & 0 deletions datahub-frontend/app/auth/AuthModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.datahubproject.metadata.context.EntityRegistryContext;
import io.datahubproject.metadata.context.OperationContext;
import io.datahubproject.metadata.context.OperationContextConfig;
import io.datahubproject.metadata.context.RetrieverContext;
import io.datahubproject.metadata.context.SearchContext;
import io.datahubproject.metadata.context.ValidationContext;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -195,6 +196,7 @@ protected OperationContext provideOperationContext(
.searchContext(SearchContext.EMPTY)
.entityRegistryContext(EntityRegistryContext.builder().build(EmptyEntityRegistry.EMPTY))
.validationContext(ValidationContext.builder().alternateValidation(false).build())
.retrieverContext(RetrieverContext.EMPTY)
.build(systemAuthentication);
}

Expand Down
2 changes: 1 addition & 1 deletion datahub-frontend/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<logger name="com.linkedin" level="DEBUG">
<appender-ref ref="DEBUG_FILE"/>
</logger>
<logger name="controller" level="DEBUG">
<logger name="controllers" level="DEBUG">
<appender-ref ref="DEBUG_FILE"/>
</logger>
<logger name="auth" level="DEBUG">
Expand Down
2 changes: 1 addition & 1 deletion datahub-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies {
// mock internal schema registry
implementation externalDependency.kafkaAvroSerde
implementation externalDependency.kafkaAvroSerializer
implementation "org.apache.kafka:kafka_2.12:3.7.1"
implementation "org.apache.kafka:kafka_2.13:3.7.2"

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.linkedin.gms.factory.kafka.common.TopicConventionFactory;
import com.linkedin.gms.factory.kafka.schemaregistry.InternalSchemaRegistryFactory;
import com.linkedin.gms.factory.search.BaseElasticSearchComponentsFactory;
import com.linkedin.metadata.aspect.CachingAspectRetriever;
import com.linkedin.metadata.config.kafka.KafkaConfiguration;
import com.linkedin.metadata.dao.producer.KafkaEventProducer;
import com.linkedin.metadata.dao.producer.KafkaHealthChecker;
Expand Down Expand Up @@ -186,6 +187,7 @@ protected OperationContext javaSystemOperationContext(
components.getIndexConvention(),
RetrieverContext.builder()
.aspectRetriever(entityServiceAspectRetriever)
.cachingAspectRetriever(CachingAspectRetriever.EMPTY)
.graphRetriever(systemGraphRetriever)
.searchRetriever(searchServiceSearchRetriever)
.build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private void readerExecutable(ReaderWrapper reader, UpgradeContext context) {
try {
aspectRecord =
EntityUtils.toSystemAspect(
context.opContext().getRetrieverContext().get(), aspect.toEntityAspect())
context.opContext().getRetrieverContext(), aspect.toEntityAspect())
.get()
.getRecordTemplate();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ public Function<UpgradeContext, UpgradeStepResult> executable() {
List<Pair<Future<?>, SystemAspect>> futures;
futures =
EntityUtils.toSystemAspectFromEbeanAspects(
opContext.getRetrieverContext().get(),
batch.collect(Collectors.toList()))
opContext.getRetrieverContext(), batch.collect(Collectors.toList()))
.stream()
.map(
systemAspect -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ static AspectsBatch generateAspectBatch(
.collect(Collectors.toList());

return AspectsBatchImpl.builder()
.mcps(mcps, auditStamp, opContext.getRetrieverContext().get())
.retrieverContext(opContext.getRetrieverContext().get())
.mcps(mcps, auditStamp, opContext.getRetrieverContext())
.retrieverContext(opContext.getRetrieverContext())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static com.linkedin.metadata.Constants.*;

import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Throwables;
import com.linkedin.common.urn.Urn;
import com.linkedin.datahub.upgrade.UpgradeContext;
Expand All @@ -23,8 +25,6 @@
import java.util.Set;
import java.util.function.Function;
import lombok.extern.slf4j.Slf4j;
import org.codehaus.jackson.node.JsonNodeFactory;
import org.codehaus.jackson.node.ObjectNode;
import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.search.SearchResponse;
import org.opensearch.client.RequestOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ public Function<UpgradeContext, UpgradeStepResult> executable() {

AspectsBatch aspectsBatch =
AspectsBatchImpl.builder()
.retrieverContext(opContext.getRetrieverContext().get())
.retrieverContext(opContext.getRetrieverContext())
.items(
batch
.flatMap(
ebeanAspectV2 ->
EntityUtils.toSystemAspectFromEbeanAspects(
opContext.getRetrieverContext().get(),
opContext.getRetrieverContext(),
Set.of(ebeanAspectV2))
.stream())
.map(
Expand All @@ -189,11 +189,7 @@ public Function<UpgradeContext, UpgradeStepResult> executable() {
.auditStamp(systemAspect.getAuditStamp())
.systemMetadata(
withAppSource(systemAspect.getSystemMetadata()))
.build(
opContext
.getRetrieverContext()
.get()
.getAspectRetriever()))
.build(opContext.getAspectRetriever()))
.collect(Collectors.toList()))
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.linkedin.upgrade.DataHubUpgradeState;
import io.datahubproject.metadata.context.OperationContext;
import io.datahubproject.metadata.context.RetrieverContext;
import java.util.Optional;
import java.util.stream.Stream;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -48,7 +47,7 @@ public void setup() {
step =
new GenerateSchemaFieldsFromSchemaMetadataStep(
mockOpContext, mockEntityService, mockAspectDao, 10, 100, 1000);
when(mockOpContext.getRetrieverContext()).thenReturn(Optional.of(mockRetrieverContext));
when(mockOpContext.getRetrieverContext()).thenReturn(mockRetrieverContext);
}

/** Test to verify the correct step ID is returned. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ export class SchemaFieldPropertiesEntity implements Entity<SchemaFieldEntity> {
// Currently unused.
getPathName = () => 'schemaField';

// Currently unused.
getEntityName = () => 'schemaField';
getEntityName = () => 'Column';

// Currently unused.
getCollectionName = () => 'schemaFields';
getCollectionName = () => 'Columns';

// Currently unused.
renderProfile = (_: string) => <></>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const DeprecatedContainer = styled.div`
justify-content: center;
align-items: center;
color: #cd0d24;
margin-left: 0px;
margin-right: 8px;
padding-top: 8px;
padding-bottom: 8px;
padding-right: 4px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import React from 'react';
import styled from 'styled-components';
import { ANTD_GRAY_V2 } from '../../../constants';

const MultiStringWrapper = styled.div``;

const StyledInput = styled(Input)`
width: 75%;
min-width: 350px;
Expand All @@ -29,10 +31,11 @@ const DeleteButton = styled(Button)`

interface Props {
selectedValues: any[];
inputType?: string;
updateSelectedValues: (values: any[]) => void;
}

export default function MultipleStringInput({ selectedValues, updateSelectedValues }: Props) {
export default function MultipleOpenEndedInput({ selectedValues, updateSelectedValues, inputType = 'text' }: Props) {
function updateInput(text: string, index: number) {
const updatedValues =
selectedValues.length > 0 ? selectedValues.map((value, i) => (i === index ? text : value)) : [text];
Expand All @@ -53,14 +56,14 @@ export default function MultipleStringInput({ selectedValues, updateSelectedValu
}

return (
<div>
<MultiStringWrapper>
{selectedValues.length > 1 &&
selectedValues.map((selectedValue, index) => {
const key = `${index}`;
return (
<InputWrapper key={key}>
<StyledInput
type="text"
type={inputType}
value={selectedValue}
onChange={(e) => updateInput(e.target.value, index)}
/>
Expand All @@ -70,14 +73,14 @@ export default function MultipleStringInput({ selectedValues, updateSelectedValu
})}
{selectedValues.length <= 1 && (
<StyledInput
type="text"
type={inputType}
value={selectedValues[0] || ''}
onChange={(e) => updateInput(e.target.value, 0)}
/>
)}
<StyledButton type="link" onClick={addNewValue}>
+ Add More
</StyledButton>
</div>
</MultiStringWrapper>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Input } from 'antd';
import React, { ChangeEvent } from 'react';
import styled from 'styled-components';
import { PropertyCardinality } from '@src/types.generated';
import { ANTD_GRAY_V2 } from '../../../constants';
import MultipleOpenEndedInput from './MultipleOpenEndedInput';

const StyledInput = styled(Input)`
border: 1px solid ${ANTD_GRAY_V2[6]};
Expand All @@ -10,15 +12,31 @@ const StyledInput = styled(Input)`

interface Props {
selectedValues: any[];
cardinality?: PropertyCardinality | null;
updateSelectedValues: (values: string[] | number[]) => void;
}

export default function NumberInput({ selectedValues, updateSelectedValues }: Props) {
export default function NumberInput({ selectedValues, cardinality, updateSelectedValues }: Props) {
function updateInput(event: ChangeEvent<HTMLInputElement>) {
const number = Number(event.target.value);
updateSelectedValues([number]);
}

function updateMultipleValues(values: string[] | number[]) {
const numbers = values.map((v) => Number(v));
updateSelectedValues(numbers);
}

if (cardinality === PropertyCardinality.Multiple) {
return (
<MultipleOpenEndedInput
selectedValues={selectedValues}
updateSelectedValues={updateMultipleValues}
inputType="number"
/>
);
}

return (
<StyledInput
type="number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { ChangeEvent } from 'react';
import styled from 'styled-components';
import { ANTD_GRAY_V2 } from '../../../constants';
import { PropertyCardinality } from '../../../../../../types.generated';
import MultipleStringInput from './MultipleStringInput';
import MultipleOpenEndedInput from './MultipleOpenEndedInput';

const StyledInput = styled(Input)`
width: 75%;
Expand All @@ -24,8 +24,15 @@ export default function StringInput({ selectedValues, cardinality, updateSelecte
}

if (cardinality === PropertyCardinality.Multiple) {
return <MultipleStringInput selectedValues={selectedValues} updateSelectedValues={updateSelectedValues} />;
return <MultipleOpenEndedInput selectedValues={selectedValues} updateSelectedValues={updateSelectedValues} />;
}

return <StyledInput type="text" value={selectedValues[0] || ''} onChange={updateInput} />;
return (
<StyledInput
type="text"
value={selectedValues[0] || ''}
onChange={updateInput}
data-testid="structured-property-string-value-input"
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export default function StructuredPropertyInput({
<DateInput selectedValues={selectedValues} updateSelectedValues={updateSelectedValues} />
)}
{!allowedValues && valueType.info.type === StdDataType.Number && (
<NumberInput selectedValues={selectedValues} updateSelectedValues={updateSelectedValues} />
<NumberInput
selectedValues={selectedValues}
cardinality={cardinality}
updateSelectedValues={updateSelectedValues}
/>
)}
{!allowedValues && valueType.info.type === StdDataType.Urn && (
<UrnInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const TitleWrapper = styled.div`
display: flex;
justify-content: left;
align-items: center;
gap: 8px;
.ant-typography-edit-content {
padding-top: 7px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { useEntityData, useRefetch } from '../../../EntityContext';
import { useGlossaryEntityData } from '../../../GlossaryEntityContext';

export const EntityTitle = styled(Typography.Title)`
margin-right: 10px;
&&& {
margin-bottom: 0;
word-break: break-all;
Expand Down
Loading

0 comments on commit bed1880

Please sign in to comment.