Hi, Thanks for the SDK :raised_hands:, is there a ...
# singer-tap-development
l
Hi, Thanks for the SDK šŸ™Œ, is there a simple way to add a name alias to a schema property?
a
Thanks, Luis! Can you say a little more about what you are trying to alias? I’m not sure I follow.
l
I have a key in the JSON, that the REST API provides, with a generic name, that i want to rename to something more descriptive, i can do it on a transformation after loading, but i was looking if there is a simple way in the SDK to do this
a
Hi, @luis_atala. Sorry for the delay in my response. The easiest way to do this is to override the
Stream.post_process()
method. That method takes a record dict, gives you the option to modify it in any way you want and then return the result.
l
Thanks! šŸ‘
a
Something like this should do it:
Copy code
def post_process(self, row: dict, partition: Optional[dict] = None) -> dict:
        """As needed, append or transform raw data to match expected structure."""
        row["new_name"] = row.pop("old_name")
        return row
l
šŸ‘Œ, nice, that's what i was looking, thanks a lot