Closed Pablompg closed 3 years ago
I got the same error for the instance: https://www.sec.gov/Archives/edgar/data/1040130/000143774921013213/pets20210331_10k.htm
Error Message
The taxonomy with namespace http://xbrl.sec.gov/dei/2019-01-31 could not be found. Please check if it is imported in the schema file
Any idea on how to solve this issue in a general way? The problem is that the .xsd
document does not import all taxonomies used. I will have a deeper look into the code and see if I can think of an elegant solution to this problem.
To deal with this issue I created a function that maps common namespaces (such as the dei or us-gaap taxonomy) to the corresponding namespace. https://github.com/manusimidt/xbrl_parser/blob/75e1bf0c973d4c875b2598b4e2e462c8a99f1162/xbrl/taxonomy.py#L149-L191
However this apparently does not work in your case. I will check why it's not working and implement a fix. I'm pretty busy until tonight, so I probably won't be able to give more detailed feedback until tomorrow.
I don't really know how to solve this in a general way. The taxonomy schema file can be stored on any server on the internet. So it is impossible to locate the taxonomy schema if you only have the namespace.
For all popular taxonomies the solution with a mapping from namespace to schema url is probably the only solution 🤔.
Seems to work now with both submissions you provided. The issue was that these submission do not even mention the us-gaap and dei taxonomies in their extension taxonomy. Due to the fact that both the us-gaap and the dei taxonomy are standard taxonomies we can easily parse and load these taxonomies even after the extension taxonomy was already parsed.
I will create a new minor version of the package that contains this change.
Awesome work! Thank you very much. I really appreciate the effort :+1:
Bug description
Steps to reproduce the behavior
Error Trace