Skip to content

Commit 49a8ece

Browse files
authored
fix(ingestion): enable compat with avro 1.11 (#4205)
1 parent e6ff600 commit 49a8ece

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

metadata-ingestion/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_long_description():
3838
"entrypoints",
3939
"docker",
4040
"expandvars>=0.6.5",
41-
"avro-gen3==0.7.1",
41+
"avro-gen3==0.7.2",
4242
"avro>=1.10.2,<1.11",
4343
"python-dateutil>=2.8.0",
4444
"stackprinter",

metadata-ingestion/tests/unit/serde/test_serde.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
import fastavro
66
import pytest
7+
from avrogen import avrojson
78
from freezegun import freeze_time
89

910
import datahub.metadata.schema_classes as models
1011
from datahub.cli.json_file import check_mce_file
12+
from datahub.emitter import mce_builder
1113
from datahub.ingestion.run.pipeline import Pipeline
1214
from datahub.ingestion.source.file import iterate_mce_file
1315
from datahub.metadata.schema_classes import MetadataChangeEventClass
@@ -145,3 +147,23 @@ def test_field_discriminator() -> None:
145147
)
146148

147149
assert cost_object.validate()
150+
151+
152+
def test_type_error() -> None:
153+
dataflow = models.DataFlowSnapshotClass(
154+
urn=mce_builder.make_data_flow_urn(
155+
orchestrator="argo", flow_id="42", cluster="DEV"
156+
),
157+
aspects=[
158+
models.DataFlowInfoClass(
159+
name="hello_datahub",
160+
description="Hello Datahub",
161+
externalUrl="http://example.com",
162+
# This is a type error - custom properties should be a Dict[str, str].
163+
customProperties={"x": 1}, # type: ignore
164+
)
165+
],
166+
)
167+
168+
with pytest.raises(avrojson.AvroTypeException):
169+
dataflow.to_obj()

0 commit comments

Comments
 (0)