Hi team, a very basic question - I have the follo...
# getting-started
p
Hi team, a very basic question - I have the following event coming to Datahub-Actions. Can you tell the best way to serialize this so that I can extract information out? I will prefer json serialisation but am okay with anything else as long as it is writtable in Python
Copy code
EventEnvelope(event_type='EntityChangeEvent_v1', event=EntityChangeEvent({'entityType': 'dataset', 'entityUrn': 'urn:li:dataset:(urn:li:dataPlatform:snowflake,user.l0.company_info,PROD)', 'category': 'TAG', 'operation': 'ADD', 'modifier': 'urn:li:tag:pii', 'parameters': None, 'auditStamp': AuditStampClass({'time': 1683562084007, 'actor': 'urn:li:corpuser:datahub', 'impersonator': None, 'message': None}), 'version': 0, '__parameters_json': {'tagUrn': 'urn:li:tag:pii'}}), meta={'kafka': {'topic': 'PlatformEvent_v1', 'offset': 4415, 'partition': 0}})
📖 1
1
🔍 1
l
Hey there 👋 I'm The DataHub Community Support bot. I'm here to help make sure the community can best support you with your request. Let's double check a few things first: ✅ There's a lot of good information on our docs site: www.datahubproject.io/docs, Have you searched there for a solution? ✅ button ✅ It's not uncommon that someone has run into your exact problem before in the community. Have you searched Slack for similar issues? ✅ button Did you find a solution to your issue? ❌ Sorry you weren't able to find a solution. I'm sending you some tips on info you can provide to help the community troubleshoot. Whenever you feel your issue is solved, please react ✅ to your original message to let us know!
b
Hi!
You want to write this to a file?
p
Let's say I want to extract the value of 'operation' field and basis the value, take some action!
essentially I want to parse the EventEnvelope in Python and extract a few values from it
b
Right right - let me find an example
p
L45 rather, no?
Thanks a ton it worked!