-
Notifications
You must be signed in to change notification settings - Fork 28
[ENH] change _MetaObjectMixin._check_objects default for attr_name to auto-detect
#466
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #466 +/- ##
==========================================
- Coverage 85.07% 83.80% -1.27%
==========================================
Files 45 52 +7
Lines 3015 3897 +882
==========================================
+ Hits 2565 3266 +701
- Misses 450 631 +181 ☔ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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