Safe-DS / DSL

Statically checked Data Science programs.
https://dsl.safeds.com
MIT License
11 stars 0 forks source link

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

Closed lars-reimann closed 2 months ago

lars-reimann commented 2 months ago

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 commented 2 months ago

:tada: This issue has been resolved in version 0.13.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: