Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
block EdgarRenderer from processing invalid facts
Browse files Browse the repository at this point in the history
  • Loading branch information
hefischer committed Mar 20, 2024
1 parent e670464 commit 510fa3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ def populateAndLinkClasses(self, uncategorizedCube = None):
# the others need to be proactively added to the set of unused facts.
if len(factSet) > 1:
def factSortKey (fact):
if getattr(fact,"xValid", 0) < VALID:
return ("", "", "")
if fact.isNumeric:
if fact.isNil: discriminator = float("INF") # Null values always last
elif fact.decimals is None: discriminator = 0 # Can happen with invalid xbrl
Expand All @@ -389,12 +391,15 @@ def factSortKey (fact):
sortedFactList = sorted(factSet, key = factSortKey)
while len(sortedFactList) > 0:
firstFact = sortedFactList.pop(0)
if getattr(firstFact,"xValid", 0) < VALID:
continue
lineNumOfFactWeAreKeeping = firstFact.sourceline
discardedLineNumberList = []
discardedCounter = 0
discardedFactList = []
# finds facts with same qname, context and unit as firstFact
while (len(sortedFactList) > 0 and
getattr(sortedFactList[0],"xValid", 0) >= VALID and
sortedFactList[0].qname == firstFact.qname and
sortedFactList[0].context == firstFact.context and
sortedFactList[0].unitID == firstFact.unitID):
Expand Down

0 comments on commit 510fa3a

Please sign in to comment.