Magic ETL

Magic ETL

Magic ETL Python script

Hello. I can't find any example to run a Magic ETL Python script.

I have added a column. I want to populate it with a pythons script and it never works

 

in the schema tab I have added a new text column named : "Alias" and here is my script : 

 

 

  1. # Import the domomagic package into the script
  2. from domomagic import *
  3. # read data from inputs into a data frame
  4. input1 = read_dataframe('dataset')
  5. # write your script here
  6.  
  7. # i dont know how to add a property "Alias" to input1 : here is what i have tried :
  8. input1["Alias"] = "test"
  9.  
  10. # write a data frame so it's available to the next action
  11. write_dataframe(input1)

 

I know I can achieve it with a simple "Add constants" but I would like to know how to use python script.

 

Best Answer

Answers

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In