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

[Bug]: DatetimeInfoExtractor prevents pipeline from being saved using joblib or pickle #257

Closed
1 task done
Decima2014 opened this issue Jun 17, 2024 · 1 comment · Fixed by #258
Closed
1 task done
Labels
bug Something isn't working

Comments

@Decima2014
Copy link

What happened?

The DatetimeInfoExtractor stores the mappings_provided attribute as a .keys() type. If you try and save a pipeline object which has that pipeline step using joblib or pickle you get an error stating that:

"TypeError: cannot pickle 'dict_keys' object".

This attribute should be stored as a list instead. We should maybe also add a test that our transformers can be saved as a pickle file

Environment

scikit-learn == 1.1.3
Python == 3.9.13
joblib == 1.3.2
tubular == 1.1.0

Minimum reproducible code

No response

Relevant error output

TypeError: cannot pickle 'dict_keys' object

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Decima2014 Decima2014 added the bug Something isn't working label Jun 17, 2024
@davidhopkinson26
Copy link
Contributor

davidhopkinson26 commented Jun 20, 2024

Thanks for raising this issue. Should be a simple fix to switch this to a list and I agree that adding a test we can pickle the objects should be added to generic tests.

The test class base_tests.OtherBaseBehaviourTests was created for this purpose and should be inherited by all transformer test modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants