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

Memoized static calls don't pass optional arguments by name #1087

Closed
lars-reimann opened this issue Apr 22, 2024 · 1 comment · Fixed by #1095
Closed

Memoized static calls don't pass optional arguments by name #1087

lars-reimann opened this issue Apr 22, 2024 · 1 comment · Fixed by #1095
Assignees
Labels
bug 🪲 Something isn't working released Included in a release
Milestone

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Apr 22, 2024

Describe the bug

Running the pipeline below leads to this error:

// GradientBoostingClassifier.__init__() takes 1 positional argument but 3 were given
//     at file:///c%3A/Users/Lars/OneDrive/Desktop/test/test.sds#45 (c:\Users\Lars\OneDrive\Desktop\test\test.sds line 45)

This happens because the optional arguments are keyword-only in the library but are passed by position.

To Reproduce

Run this pipeline

pipeline example {
    val model = GradientBoostingClassifier();
}

Expected behavior

No error. This definitely requires changes in the code generator. It would also be eased, if safeds_runner.memoized_static_call and safeds_runner.memoized_dynamic_call would take separate lists for positional arguments (list) and keyword arguments (map). While we are at it, we could split off the self argument of the memoized_dynamic_call.

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added the bug 🪲 Something isn't working label Apr 22, 2024
@lars-reimann lars-reimann added this to the v0.13.0 milestone Apr 22, 2024
@lars-reimann lars-reimann self-assigned this Apr 22, 2024
@lars-reimann lars-reimann added this to DSL Apr 22, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DSL Apr 22, 2024
@lars-reimann lars-reimann moved this from Backlog to Todo in DSL Apr 23, 2024
lars-reimann added a commit to Safe-DS/Runner that referenced this issue Apr 23, 2024
Related to Safe-DS/DSL#1087

### Summary of Changes

Memoized calls now accept positional and keyword arguments separately.

---------

Co-authored-by: megalinter-bot <[email protected]>
@lars-reimann lars-reimann linked a pull request Apr 24, 2024 that will close this issue
lars-reimann added a commit that referenced this issue Apr 24, 2024
Closes #1087

### Summary of Changes

Optional argument of memoized calls are now stored in a separate dict,
so they can be passed by name in the runner.
@github-project-automation github-project-automation bot moved this from Todo to ✔️ Done in DSL Apr 24, 2024
lars-reimann pushed a commit that referenced this issue Apr 24, 2024
## [0.13.0](v0.12.0...v0.13.0) (2024-04-24)

### Features

* allow schemas in pipeline files ([#1080](#1080)) ([9508178](9508178)), closes [#1077](#1077)
* annotations `@Category` and `@Tags` ([#1061](#1061)) ([e45a4c9](e45a4c9)), closes [#1021](#1021)
* check if latest runner is installed ([#1097](#1097)) ([93432bb](93432bb)), closes [#1096](#1096)
* do not check whether optional type parameters of classes can be inferred ([#1090](#1090)) ([31b8a28](31b8a28)), closes [#1084](#1084) [#1084](#1084)
* generate nested functions for expression lambdas ([#1062](#1062)) ([f79fd61](f79fd61))
* mark schemas as experimental ([#1089](#1089)) ([09faaf0](09faaf0)), closes [#1078](#1078)
* print values via code lens ([#1072](#1072)) ([f338023](f338023)), closes [#1032](#1032)
* run pipeline via code lens ([#1068](#1068)) ([392154d](392154d))
* show image via code lens ([#1071](#1071)) ([bd0946b](bd0946b)), closes [#984](#984)

### Bug Fixes

* import error when exploring tables in pipelines that call segments ([#1074](#1074)) ([e34b3ff](e34b3ff))
* pass optional arguments of memoized calls by name ([#1095](#1095)) ([39d9e5a](39d9e5a)), closes [#1087](#1087)
* possible restart loop after installing the runner ([#1073](#1073)) ([7206d62](7206d62))
* runner not shutting down when extension was closed ([#1094](#1094)) ([77a0c1f](77a0c1f))
* stub for `Table.transformColumn` ([#1065](#1065)) ([aa43316](aa43316))
* type check arguments of annotation calls ([#1060](#1060)) ([09ca1cf](09ca1cf))
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Apr 24, 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
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant