Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong code generatation for expression lambdas #1136

Closed
saius02 opened this issue May 3, 2024 · 1 comment · Fixed by #1137
Closed

Wrong code generatation for expression lambdas #1136

saius02 opened this issue May 3, 2024 · 1 comment · Fixed by #1137
Assignees
Labels
bug 🪲 Something isn't working released Included in a release

Comments

@saius02
Copy link

saius02 commented May 3, 2024

Describe the bug

Code generation for lambdas does not work properly if the lambda declares new local declarations.

To Reproduce

package train

pipeline house {

    val data = Table.fromCsvFile("data/train.csv");
    val heat = data.plotCorrelationHeatmap();

    val remove = data.removeColumns(["Id","MSSubClass","MSZoning","LotFrontage","LotArea","Street","Alley","LotShape","LandContour","Utilities","LotConfig","LandSlope","Neighborhood","Condition1","Condition2","BldgType","HouseStyle","OverallCond","YearBuilt","YearRemodAdd","RoofStyle","RoofMatl","Exterior1st","Exterior2nd","MasVnrType","MasVnrArea","ExterQual","ExterCond","Foundation","BsmtQual","BsmtCond","BsmtExposure","BsmtFinType1","BsmtFinSF1","BsmtFinType2","BsmtFinSF2","BsmtUnfSF","TotalBsmtSF","Heating","HeatingQC","CentralAir","Electrical","1stFlrSF","2ndFlrSF","LowQualFinSF","BsmtFullBath","BsmtHalfBath","FullBath","HalfBath","BedroomAbvGr","KitchenAbvGr","KitchenQual","TotRmsAbvGrd","Functional","Fireplaces","FireplaceQu","GarageType","GarageYrBlt","GarageFinish","GarageQual","GarageCond","PavedDrive","WoodDeckSF","OpenPorchSF","EnclosedPorch","3SsnPorch","ScreenPorch","PoolArea","PoolQC","Fence","MiscFeature","MiscVal","MoSold","YrSold","SaleType","SaleCondition"]);

    val removedoutliers = remove.filterRows((row) -> ((row.getValue("GarageCars") as Int) < 4));
}

Expected behavior

Code generation should work.

Screenshots (optional)

No response

Additional Context (optional)

No response

@saius02 saius02 added the bug 🪲 Something isn't working label May 3, 2024
@lars-reimann lars-reimann self-assigned this May 3, 2024
@lars-reimann lars-reimann changed the title Wrong code generatation for lambdas Wrong code generatation for expression lambdas May 3, 2024
lars-reimann added a commit that referenced this issue May 3, 2024
…das (#1137)

Closes #1136

### Summary of Changes

Extra statements that were generated for the expression of an expression
lambda were incorrectly placed outside the lambda. This broke the code
generation for parameters of expression lambdas that were used as
receivers of method calls (see the linked issue).
lars-reimann pushed a commit that referenced this issue May 3, 2024
## [0.14.1](v0.14.0...v0.14.1) (2024-05-03)

### Bug Fixes

* generation of extra statements for parameters of expression lambdas ([#1137](#1137)) ([4add401](4add401)), closes [#1136](#1136)
@lars-reimann
Copy link
Member

🎉 This issue has been resolved in version 0.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working released Included in a release
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

2 participants