Problem of Python Scripts on OAS DV — Oracle Analytics

Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Problem of Python Scripts on OAS DV

Received Response
267
Views
3
Comments

Hi Everyone,

In our company, business users want more flexibily on capabilities of OAS DV machine learning side. Especially they want to use ML side, write python codes. To understand its capabilities, I wrote an xml script by looking the below post and uploaded it into DV side. After that, I created a very simple data flow and used that script. When I try to run data flow, it gives following error. What can be the solution of this problem? I searched on google but could not find :(

https://www.rittmanmead.com/blog/2022/11/leveraging-custom-python-scripts-in-oas/

sorun.png

Regards,

Dilek

Answers

  • When you performed the step "create script" could it parse your script fine identifying the input, output parameters, etc.? If you test the script outside of dv does it render output fine? Are you passing any input arguments needed in the data flow for the script? You can try to look at session.log or obis-query log for errors? Without looking at the actual script and definition of data flow it might be hard to troubleshoot.

  • In addition, it is always helpful to post your version OAS 2022 or OAS 2023, and your platform.

    For example, on Linux, you need to ensure libgfortran is installed


    I have also observed occurrences when the XML wrapper script has a line return in it, that can cause issues.


    For example, in the script description, it needs to be one line without line breaks.

    <scriptdescription>
    	<![CDATA[
    		This script performs classification and regression with Random Forest on the input data.
    		The input is a data frame with target, attribute1, attributes2....
    		The output includes model object and model descriptive data.
    	]]>
    	</scriptdescription>
    



    The error message returned is of the generic type, so you should start with @GayathriAnand-Oracle 's advice.

    It may be difficult to determine your issue without log review, or script review.

  • Hi @dilek ,

    I wrote that blog post for OAS 6.4.

    To enable the custom script feature in OAS 2023, you should refer to Doc ID 2675894.1 instead: https://support.oracle.com/epmos/faces/DocContentDisplay?id=2675894.1

    Before executing the script from a data flow, it's always a good practice to test your code directly:

    1. Navigate to $ORACLE_HOME/bi/modules/oracle.bi.dvml
    2. Execute ./dvmlruntime to determine the Python version used in your OAS environment
    3. Install the same version of Python on the machine running OAS (in a different location)
    4. Install all the required Python packages on the Python that you installed in step 3
    5. Set the PYTHONPATH variable as described in the blog post
    6. (Optional) Create a CSV file for any input data
    7. Test your code: ./dvmlruntime test.py

    If step 6 executes without any errors, then you can test the data flow in DV.