Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
pedrocavaco
Participant
In SAP Datasphere if we need to transform null fields coming from a source, we can achieve it using the (python) script operator, for that we can use the following code:
def transform(data):

data['Field1'].fillna('value_to_replace_the_null', inplace=True)
data['Field2'].fillna('9999', inplace=True)
data['Field3'].fillna('ABC', inplace=True)
data['Field4'].fillna('XYZ', inplace=True)
data['FieldN'].fillna('1111', inplace=True)

return data


There are other ways to achieve the same result, but still this is useful if you have any connection limitations and need some ETL while your only option is to use a Data Flow:


Even though we (currently) don't have a syntax validator for the script operator, it still is a powerful tool.
2 Comments
Labels in this area