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

Fix/no lambda function in add_encoders #1957

Merged
merged 9 commits into from
Aug 31, 2023
Merged

Conversation

madtoinou
Copy link
Collaborator

Fixes #1843.

Summary

  • Raise an error when a lambda function is used in the add_encoders parameter so that model pickling works as intended when saving the model.
  • Updated documentation and notebooks accordingly

Other Information

  • Since all the examples in the documentation (notebook included) used lambda function, this will probably cause issue for a lot of user.
  • Instead of an exception, we could eventually just display a warning so that users can eventually use another pickling module that user lambda functions.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov-commenter
Copy link

codecov-commenter commented Aug 17, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (6096968) 93.84% compared to head (9695dff) 93.84%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1957      +/-   ##
==========================================
- Coverage   93.84%   93.84%   -0.01%     
==========================================
  Files         132      132              
  Lines       12731    12721      -10     
==========================================
- Hits        11948    11938      -10     
  Misses        783      783              
Files Changed Coverage Δ
darts/dataprocessing/encoders/encoders.py 97.61% <100.00%> (+0.03%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @madtoinou 🚀
Only thing left is to update the add_encoders model docs that still use the lambda functions.

Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @madtoinou 🚀
Last thing to do is add it to the changelog, as a breaking change).

@dennisbader dennisbader merged commit e1abf51 into master Aug 31, 2023
7 of 9 checks passed
@dennisbader dennisbader deleted the fix/no_lambda_encoder branch August 31, 2023 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

[BUG] PicklingError: "Can't pickle : attribute lookup on __main__ failed" happend when fit model
3 participants