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

LIN-586 alt fix for parenthesis block #787

Closed lionsardesai closed 1 year ago

lionsardesai commented 1 year ago

Description

Multi-line statements are causing a slicing error. This PR should fix the following example

Consider following code

x = 1
y = 2
a = (
    x+y
)
arta = lineapy.save(a,'a')
arta.get_code()

currently, we will see error because we only slice out

x = 1
y = 2
    x+y

and the indentation is not correct.

Fixes # (issue)

How Has This Been Tested?

Pass all existing tests and add new tests