Minor: Fix kafka Topic Entity Import (#14227)

This commit is contained in:
Mayur Singal 2023-12-04 21:08:33 +05:30 committed by GitHub
parent 28c0b22f18
commit 4843d85bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ from confluent_kafka.schema_registry.avro import AvroDeserializer
from confluent_kafka.schema_registry.schema_registry_client import Schema
from metadata.generated.schema.api.data.createTopic import CreateTopicRequest
from metadata.generated.schema.entity.data.topic import Topic as TopicEntity
from metadata.generated.schema.entity.data.topic import TopicSampleData
from metadata.generated.schema.metadataIngestion.workflow import (
Source as WorkflowSource,
@ -218,7 +219,7 @@ class CommonBrokerSource(MessagingServiceSource, ABC):
service_name=self.context.messaging_service,
topic_name=self.context.topic,
)
topic_entity = self.metadata.get_by_name(entity=Topic, fqn=topic_fqn)
topic_entity = self.metadata.get_by_name(entity=TopicEntity, fqn=topic_fqn)
if topic_entity and self.generate_sample_data:
topic_name = topic_details.topic_name
sample_data = []