| Conditions | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 1 | from typing import List |
|
| 24 | 1 | def resolve_object_property(obj, path: str): |
|
| 25 | """Resolves the value of a property on an object. |
||
| 26 | |||
| 27 | Is able to resolve nested properties. For example, |
||
| 28 | a path can be specified: |
||
| 29 | |||
| 30 | 'other.beer.name' |
||
| 31 | |||
| 32 | Raises: |
||
| 33 | AttributeError: |
||
| 34 | In case the property could not be resolved. |
||
| 35 | |||
| 36 | Returns: |
||
| 37 | The value of the specified property. |
||
| 38 | """ |
||
| 39 | |||
| 40 | 1 | value = obj |
|
| 41 | 1 | for path_part in path.split('.'): |
|
| 42 | 1 | value = getattr(value, path_part) |
|
| 43 | |||
| 44 | return value |
||
| 45 |
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.