xbrlus / xule

An open-source XBRL processor for business rules, rendering and custom data reporting. See https://xbrl.us/xule for documentation and https://xbrl.us/xule-editor for a VS Code syntax highlighter.
Apache License 2.0
25 stars 10 forks source link

Handle the case were model type is a list #11

Closed derekgengenbacher-wf closed 2 years ago

derekgengenbacher-wf commented 2 years ago

Description:

xbrli:dateTimeItemType derives from DateUnion, which has 2 parents(date and dateTime). When the hierarchy code tries to establish this hierarchy it blows up because it is not expecting a list as the derived from type. This causes a 'list' object has no attribute 'typeDerivedFrom` python error.

This PR updates _type_ancestry() to cache ancestry to improve performance as well as handling multiple parent derivation.

Testing:

Run list_no_typeDerivedFrom.zip and verify that the 'list' object has no attribute 'typeDerivedFrom` no longer gets thrown in the validation results.

@campbellpryde @davidtauriello