Fix EnsureListOf() and EnsureTupleOf() for string inputs#7267
Conversation
Codecov ReportBase: 88.72% // Head: 90.55% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## maint #7267 +/- ##
==========================================
+ Coverage 88.72% 90.55% +1.82%
==========================================
Files 326 326
Lines 44423 44425 +2
Branches 5919 0 -5919
==========================================
+ Hits 39415 40229 +814
+ Misses 4993 4196 -797
+ Partials 15 0 -15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
|
||
| def __call__(self, value): | ||
| return tuple(map(self._dtype, value)) | ||
| return tuple(map(self._dtype, ([value] if isinstance(value, str) else value))) |
There was a problem hiding this comment.
Well spotted.
To reduce code duplication: I think in this both cases we could just use ensure_list or ensure_tuple in both cases from https://github.com/datalad/datalad/blob/HEAD/datalad/utils.py#L734.
adswa
left a comment
There was a problem hiding this comment.
This PR can be merged from my point of view
|
Let's do it then. tuneups to reduce code duplication could be done later. |
|
PR released in |
EnsureListOf()andEnsureTupleOf()took string inputs as iterables. This PR fixes this.(I don't understand this
scrivthing,scriv createetc. all error out with unfound files, so I'll leave it to you to add this CHANGELOG label.)