[ENH] change _MetaObjectMixin._check_objects default for attr_name to auto-detect#466
[ENH] change _MetaObjectMixin._check_objects default for attr_name to auto-detect#466SimonBlanke wants to merge 24 commits intosktime:mainfrom
_MetaObjectMixin._check_objects default for attr_name to auto-detect#466Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #466 +/- ##
==========================================
- Coverage 85.07% 84.00% -1.08%
==========================================
Files 45 52 +7
Lines 3015 3913 +898
==========================================
+ Hits 2565 3287 +722
- Misses 450 626 +176 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
added a test 'test_check_objects_attr_name_explicit'. The asserts are not that useful, but it at least covers some additional code if |
|
added another test 'test_check_objects_attr_name_custom_tag'. It sets a custom tag via I just realized, that I used a private method |
|
@fkiraly I improved the test quality by triggering an error in each test and catching the error type. |
attr_name_MetaObjectMixin._check_objects default for attr_name to auto-detect
_MetaObjectMixin._check_objects default for attr_name to auto-detect_MetaObjectMixin._check_objects default for attr_name to auto-detect
fkiraly
left a comment
There was a problem hiding this comment.
I think the coupling to self should happen at least one layer higher, i.e., not in the checker function, but where it is being called.
Otherwise we have intransparent coupling in a function that looks like a pure function but actually is not.
I understand we have some hidden coupling going on in I'll think about how to solve this. |
Yes, exactly - are there any other tags that get read in there? |
No, I only see def _check_objects(self, objs, attr_name=None, ...):
"""Orchestration/high-level layer."""
if attr_name is None:
attr_name = self.get_tag("named_object_parameters")
validated = self._validate_objects(objs, attr_name, ...)
return self._coerce_to_named_object_tuples(validated, ...)
@staticmethod
def _validate_objects(objs, attr_name, cls_type=None, ...):
# All validation logic |
for more information, see https://pre-commit.ci
|
okay there is a lot going on here (or maybe this is just in my head). First I added this note, because
|
|
There is a linter error in a file I did not change: |
…ke/skbase into feature/change-default
fixed! |
Reference Issues/PRs
Closes #159
What does this implement/fix? Explain your changes.
Sets
attr_nametoNoneand auto detect from "named_object_parameters" ofattr_nameremainsNoneDoes your contribution introduce a new dependency? If yes, which one?
What should a reviewer concentrate their feedback on?
Any other comments?
PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions