Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Access Policy transformation
  6. B2B transformation
  7. Aggregator transformation
  8. Cleanse transformation
  9. Data Masking transformation
  10. Data Services transformation
  11. Deduplicate transformation
  12. Expression transformation
  13. Filter transformation
  14. Hierarchy Builder transformation
  15. Hierarchy Parser transformation
  16. Hierarchy Processor transformation
  17. Input transformation
  18. Java transformation
  19. Java transformation API reference
  20. Joiner transformation
  21. Labeler transformation
  22. Lookup transformation
  23. Machine Learning transformation
  24. Mapplet transformation
  25. Normalizer transformation
  26. Output transformation
  27. Parse transformation
  28. Python transformation
  29. Rank transformation
  30. Router transformation
  31. Rule Specification transformation
  32. Sequence Generator transformation
  33. Sorter transformation
  34. SQL transformation
  35. Structure Parser transformation
  36. Transaction Control transformation
  37. Union transformation
  38. Velocity transformation
  39. Verifier transformation
  40. Web Services transformation

Transformations

Transformations

Creating Python code snippets

Creating Python code snippets

To create Python code snippets that define transformation functionality, use the Python editor on the
Python
tab.
The following image shows the
Python
tab with the Python editor expanded:
This screenshot shows areas of the Python editor as described in the legend.
  1. Inputs and Outputs tabs. Use these tabs to add incoming fields and output fields as variables in the Python code snippets. The fields and methods displayed on these tabs vary based on which section of the code entry area is selected.
  2. Go to list. Use to switch among the sections in the code entry area.
  3. Minimize, Open Both, and Maximize icons. Use the Minimize and Maximize buttons to minimize and maximize the transformation properties. Use the Open Both icon to open the Mapping Designer canvas and the transformation properties at the same time.
  4. Code entry area. Enter Python code snippets in the
    Pre-Partition Python Code
    ,
    Main Python Code
    , and
    Post-Partition Python Code
    sections.
To expand the transformation properties so that you can see the code entry area more fully, click
Maximize
.
To create Python code snippets, perform the following tasks:
  1. Select the section in which you want to enter a code snippet in the
    Go to
    list.
  2. To access an incoming field or output field in the snippet, select the field on the
    Inputs
    or
    Outputs
    tab, and click
    Add
    .
    You can also create output fields on the
    Outputs
    tab by clicking
    Create New Field
    .
  3. Write appropriate Python code based on the section.

0 COMMENTS

We’d like to hear from you!