Hello, I came up with another question. I would li...
# ingestion
f
Hello, I came up with another question. I would like to change part of the urn of a given entity via a transformer. For example, I would like to replace the word “prod” with “dev” on the urn string (The reasons for this have to do with out internal architecture). Is this a possibility? There does not seem to exist a guide for this on the docs. Thank you! Version: acryl-datahub, version 0.8.38
Mayne this is the anwer Transformers | DataHub (datahubproject.io)
b
yup I believe you could use transformers in this situation!
f
Hey @bulky-soccer-26729 could you help me out here by giving me a piece of code to do this?
b
I'm thinking it's possible you can use the section Add dataset browse paths - if you check out the top you'll want to adjust the ENV piece (from prod -> dev) as well as setting
replace_existing: True
so it sets the entity instead of appending https://datahubproject.io/docs/metadata-ingestion/transformers/#add-dataset-browse-paths
f
Will give it a try thanks!
b
of course!
f
SO I think that what I really want is changing a part of the DATASET_PARTS
@bulky-soccer-26729 heres an example of what I want; Change
urn:li:dataset:(urn:li:dataPlatform:redshift,production.table,PROD)
to
urn:li:dataset:(urn:li:dataPlatform:redshift,development.table,PROD)
The problem is that the redshift database is called production, but I want to change it to development (without changing the underlying database name ofc). Does not seem to be possible to do so with the above transformer
b
okay gotcha. just to understand the situation a bit more first, is prod / development a platform instance? or is that a schema inside of redshift?
f
hmmm development is the redshift database name, I want to change it to production. But it’s the name of the redshift database where the tables are
I was wondering if I could just use a transformer to replace a substring, would most likely be the easiest way to do this
Hey @bulky-soccer-26729, since I have your attention on the other thread, did you end up having time to look into this? 🙂
b
hey! so sorry this must have slipped by me.. I did ask around about this as I'm personally less familiar with transformers. However, I was told that doing such a transformation (for your case) via a transformer would be possible via a custom transformer. But that will lead to all kind of lineage issues as the source does not know about the transformation that happened in URN names. So unfortunately that change wouldn't be something we support out of the box, but you could do it (with caution as it would affect relationships to the entity you transform)
f
Alright I will keep digging. This is not critical, it would be just for a test that we are running. Thanks!
b
sounds good, and of course!