Posts

Showing posts from November, 2023

Auto generated mail in dataiku

 If  you want to setup auto generated mail in dataiku which send success or failure status before or after job submit. Then please follow below steps. Steps 1. Create scenario. 2. Setting -  Reports 3. Add Reports 4. Mail - Provide name relevant  to your mail. 5. Run Condition - On 6. Channel - mail(smpt)       outcome == 'SUCCESS' 7. Sender - SMPT server name provide by your team which configuring mail server.         example - alerts@abc.com 8.  Recipients - To whom you want to send mail ( name1@gmail.com) 9. Subject - If you want to change the subject you can change it. 10. Steps :- One on build (database) 11. Save  12 Run Scenario

Convert csv to XML file

Please find  below code to convert csv file to xml.  # -*- coding: utf-8 -*- import dataiku import pandas as pd, numpy as np from dataiku import pandasutils as pdu from lxml import etree as et Dept_3 = dataiku.Dataset("Dept_3") df = Dept_3.get_dataframe() df['deptno'] = df['deptno'].astype(str) root= et.Element('data') # iterate over rows and add to the tree for ix, row in df.iterrows():     item = et.SubElement(root, 'item', attrib=row.to_dict()); # get a handle on the folder to write xml_files = dataiku.Folder("xfile") with xml_files.get_writer("dept.xml") as w:     w.write(et.tostring(root, encoding='UTF-8', xml_declaration=False))