LineaLabs / lineapy

Move fast from data science prototype to pipeline. Capture, analyze, and transform messy notebooks into data pipelines with just two lines of code.
https://lineapy.org
Apache License 2.0
662 stars 58 forks source link

Adjust get_function/to_pipeline input parameter order as user's input. #791

Closed mingjerli closed 1 year ago

mingjerli commented 1 year ago

Description

Originally, the order is based on the appearance of the session code. It is actually not very desirable, especially in multiple sessions cases.

Basically, if we ran

lineapy.get_function(['a'], input_parameters=['x','y'])

we might get

def run_all_sessions(x, y)

or

def run_all_sessions(y, x)

depending on the ordering of variable x and y appearance in the session code.

This PR will make it always in the order of the user's input; i.e.,

def run_all_sessions(x,y)

Fixes # (issue)

LIN-611

Type of change

How Has This Been Tested?

Update the test result of the existing test case.

The modified existing test case is an example of the user's input does not agree with what the appearance order in the original code, so we need to modify the case.