File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def get_long_description():
38
38
"entrypoints" ,
39
39
"docker" ,
40
40
"expandvars>=0.6.5" ,
41
- "avro-gen3==0.7.1 " ,
41
+ "avro-gen3==0.7.2 " ,
42
42
"avro>=1.10.2,<1.11" ,
43
43
"python-dateutil>=2.8.0" ,
44
44
"stackprinter" ,
Original file line number Diff line number Diff line change 4
4
5
5
import fastavro
6
6
import pytest
7
+ from avrogen import avrojson
7
8
from freezegun import freeze_time
8
9
9
10
import datahub .metadata .schema_classes as models
10
11
from datahub .cli .json_file import check_mce_file
12
+ from datahub .emitter import mce_builder
11
13
from datahub .ingestion .run .pipeline import Pipeline
12
14
from datahub .ingestion .source .file import iterate_mce_file
13
15
from datahub .metadata .schema_classes import MetadataChangeEventClass
@@ -145,3 +147,23 @@ def test_field_discriminator() -> None:
145
147
)
146
148
147
149
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 ()
You can’t perform that action at this time.
0 commit comments