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

Set empty list if preprocess_steps is None #780

Merged
merged 2 commits into from
Apr 18, 2024
Merged

Set empty list if preprocess_steps is None #780

merged 2 commits into from
Apr 18, 2024

Conversation

marukaz
Copy link
Contributor

@marukaz marukaz commented Apr 18, 2024

Fix #778

I considered three options to solve the problem:

  1. reinstate None check
  2. Change default of preprocess_steps to []
  3. Assign [] in post init process if it's None

I chose 3 because

  • if we do 1, same check will be needed whenever we add code for preprocess steps
  • Regarding 2, as is well known, Python's default arguments are static and shared by all instances. Although this problem does not often cause confusion with Card, I would like to avoid it just in case

@marukaz
Copy link
Contributor Author

marukaz commented Apr 18, 2024

I tried to solve src/unitxt/standard.py:189:9: C901 prepare is too complex (11 > 10) but I felt the code is reasonable, so added this file to ignore list.

@yoavkatz yoavkatz merged commit f8102c4 into IBM:main Apr 18, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_card fails when preprocess_steps is None
2 participants