Closed williambrach closed 1 month ago
Thank you @williambrach ! Yes a PR is welcome! Though this may suggest we need a more fundamental solution to this cc: @XenonMolecule
Thank you @okhat for asap response. Should I wait for @XenonMolecule to discuss potential solution (e.g updating regex to support any string not only None) or I should create PR with "None" fix?
Thanks!
Thanks @williambrach ! I'd want to wait for @XenonMolecule to consider what's a fundamental fix here because we don't just want to keep making small patches to MIPRO.
To make sure you're unblocked, @williambrach , perhaps you need to just remove the type annotation for now :D
@okhat don't worry. I completed of run of my DSPy experiments without -> None
annotation
fixed
The current regex pattern used to extract the init method content doesn't account for return type annotations, specifically -> None. This causes an error when processing classes with annotated init methods.
Current Behavior
The following code snippet causes an error:
Error message:
Workaround
Removing -> None from the init method signature allows MIPROv2 to work:
Proposed Solution
Update the regex pattern to optionally match return type annotations:
This pattern should match init methods both with and without -> None annotations.
I can create PR if solution my is suitable :)