fix(ingestion): Correct Topic import in Kinesis source (#20787)

This PR fixes a bug in the Kinesis messaging source where the `Topic` class was incorrectly imported from `metadata.generated.schema.type.schema` instead of the correct entity
  definition path `metadata.generated.schema.entity.data.topic`.

  **Problem:**
  The `yield_topic_sample_data` method used the `type.schema.Topic` definition when calling `fqn.build` and `metadata.get_by_name`. These functions expect the main entity
  class.

  **Fix:**
  Changed the import statement to use `metadata.generated.schema.entity.data.topic.Topic`.

  This ensures the correct type definition is used when interacting with the FQN utility and metadata API, preventing potential downstream issues.
This commit is contained in:
Sasha Malahov 2025-04-13 00:38:07 -04:00 committed by GitHub
parent 9b24916231
commit 6dac3550ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,7 @@ from metadata.generated.schema.type.basic import (
FullyQualifiedEntityName,
SourceUrl,
)
from metadata.generated.schema.type.schema import Topic
from metadata.generated.schema.entity.data.topic import Topic
from metadata.ingestion.api.models import Either
from metadata.ingestion.api.steps import InvalidSourceException
from metadata.ingestion.models.ometa_topic_data import OMetaTopicSampleData