You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
XBRL.from_directory() skips a schema saved as .xsd.xml and parses it as an instance #2070
XBRL.from_directory() only treats *.xsd files as schemas (parse_directory in edgar/xbrl/parsers/coordinator.py). A schema saved as .xsd.xml is never parsed as a schema, and because the instance filter only skips _lab.xml, _pre.xml, _cal.xml and _def.xml, the same file is handed to the instance parser instead.
Files downloaded from SEC end in .xsd, so this mostly affects local copies saved with an .xml suffix. Five of our own fixtures are named that way: tsla, msft, gbdc, aapl/10k_2022 and ibm/10k_2024 under tests/fixtures/xbrl/.
It showed up while reviewing #1992. With the Tesla fixture (June 2024 10-Q, 0001628280-24-032662), the schema's target namespace is never recorded, so by_extension() raises its "no filing schema with a target namespace was loaded" error:
Expected: from_directory() recognises *.xsd.xml as a schema and keeps it out of the instance list. The fix should also check that tests reading these five fixtures through from_directory() still pass once their schemas load, since element metadata such as period type and balance comes from the schema.
Activity