mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-04 14:44:02 +00:00
fix(ingest): serialization - tighten conditions for restli json transformation (#3973)
This commit is contained in:
parent
8dbde4bf0d
commit
ea5a66bbc5
@ -5,10 +5,10 @@ from typing import Any
|
||||
def pre_json_transform(obj: Any) -> Any:
|
||||
if isinstance(obj, (dict, OrderedDict)):
|
||||
if len(obj.keys()) == 1:
|
||||
key = list(obj.keys())[0]
|
||||
key: str = list(obj.keys())[0]
|
||||
value = obj[key]
|
||||
if key.find("com.linkedin.pegasus2avro.") >= 0:
|
||||
new_key = key.replace("com.linkedin.pegasus2avro.", "com.linkedin.")
|
||||
if key.startswith("com.linkedin.pegasus2avro.") >= 0:
|
||||
new_key = key.replace("com.linkedin.pegasus2avro.", "com.linkedin.", 1)
|
||||
return {new_key: pre_json_transform(value)}
|
||||
|
||||
if "fieldDiscriminator" in obj:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user