datacollector: enable getting nested attributes #1715
philip928lin
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I'm not sure if the use case is common to the point that this should be in the library. In the meantime, you can define |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I try to have a model_reporters to access nested attributes like {"Col1": "a.b.c.d"}.
The current reporter will return None as the default for getattr().
One solution I found is to substitute getattr() at line 175 of the datacollection module to rgetattr() shown below.
This will do the trick. Source: https://stackoverflow.com/questions/31174295/getattr-and-setattr-on-nested-subobjects-chained-properties
New code for collect():
Beta Was this translation helpful? Give feedback.
All reactions