Skip to content

Commit

Permalink
test: fix ci issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-salvi-apptware committed Nov 14, 2024
1 parent cedd6de commit b448b0a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions metadata-ingestion/tests/unit/test_cassandra_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest

from datahub.ingestion.source.cassandra.cassandra import CassandraToSchemaFieldConverter
from datahub.ingestion.source.cassandra.cassandra_api import CassandraColumn
from datahub.metadata.com.linkedin.pegasus2avro.schema import SchemaField

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -55,11 +56,23 @@ def assert_field_paths_match(
def test_cassandra_schema_conversion(
schema: str, expected_field_paths: List[str]
) -> None:

schema_dict: Dict[str, List[Any]] = json.loads(schema)
column_infos: List = schema_dict["column_infos"]
actual_fields = list(
CassandraToSchemaFieldConverter.get_schema_fields(column_infos)
)

column_list: List[CassandraColumn] = [
CassandraColumn(
keyspace_name=row["keyspace_name"],
table_name=row["table_name"],
column_name=row["column_name"],
clustering_order=row["clustering_order"],
kind=row["kind"],
position=row["position"],
type=row["type"],
)
for row in column_infos
]
actual_fields = list(CassandraToSchemaFieldConverter.get_schema_fields(column_list))
assert_field_paths_match(actual_fields, expected_field_paths)


Expand Down

0 comments on commit b448b0a

Please sign in to comment.