-
Notifications
You must be signed in to change notification settings - Fork 169
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
Allow internal data function calls directly from our data class #360
Conversation
0c07e0a
to
c57e155
Compare
class_name = self.__class__.__name__ | ||
data_class_name = self.data.__class__.__name__ | ||
if (not f"'{class_name}' object has no attribute '{name}'" | ||
== str(attr_error)): |
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.
Its seems strange to use error string for the conditional, but I'm not sure any other way to do this check
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 validate it is an attribute error with the except and then validate the string, there might be a better way.
|
||
# validate will auto call the data function if it doesn't exist in | ||
# BaseData | ||
self.assertEqual("success", data.func1()) |
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.
personally, did you try this with csv/pandas functions?
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.
yes.
…talone#360) * feat: allow internal data function calls directly from our data class * fix: error raise comment and pep8 fixes
This allows the user to directly access functions of the wrapped data inside of our data class. e.g. if the data internally is a pandas dataframe: