witty-butcher-82399
07/08/2021, 10:42 AMIf you’d like to add more complex logic for assigning ownership, you can use the more generic `add_dataset_ownership` transformer, which calls a user-provided function to determine the ownership of each dataset.Is there any example of this? I’m not sure how to set such a function in the yaml. Also, does the function need to be registered somewhere? Thanks!
better-orange-49102
07/08/2021, 10:51 AMsource:
type: mssql
config:
username: sa
password: ${MSSQL_PASSWORD}
database: DemoData
transformers:
- type: "simple_add_dataset_ownership"
config:
owner_urns:
- "urn:li:corpuser:username1"
- "urn:li:corpuser:username2"
- "urn:li:corpGroup:groupname"
sink:
type: "datahub-rest"
config:
server: "<http://localhost:8080>"
source: https://github.com/linkedin/datahub/tree/master/metadata-ingestionwitty-butcher-82399
07/08/2021, 12:38 PMsimple_add_dataset_ownership
. However I’m looking for an example for the add_dataset_ownership
transform. The particularity of this transform if that the config is a callback function. So I want to understand eg whether it requires some registration.square-activity-64562
07/08/2021, 12:46 PMloud-island-88694
gray-shoe-75895
07/08/2021, 5:40 PMgray-shoe-75895
07/09/2021, 7:48 PMtransformers:
# Assuming `from <http://import.path.to|import.path.to> import MyTransformer` works and is derived from the Transformer base class:
- type: "import.path.to.MyTransfomer"
config:
some_property: "some.value"
To define the function of the add_dataset_owners or add_dataset_tags, once this PR is merged https://github.com/linkedin/datahub/pull/2858, you can do something along these lines:
transformers:
- type: "add_dataset_tags"
config:
get_tags_to_add: "import.path.to.myfunction" # assuming `from <http://import.path.to|import.path.to> import myfunction` works
witty-butcher-82399
07/12/2021, 6:50 AM