edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

EntityFacts.discover_concept_tags() returns empty for all IFRS filers (missing ifrs-full: prefix)

Open amcamc92 opened this issue 9 months ago • 2 comments

Issue Type

  • [x] Data Quality Issue (incorrect financial values, missing data)
  • [x] XBRL Parsing Issue (statement rendering, concept mapping)
  • [ ] Filing Access Issue (download failures, attachment problems)
  • [ ] Performance Issue (slow operations, memory problems)
  • [ ] Compatibility Issue (platform/dependency conflicts)
  • [ ] Documentation Issue (unclear instructions, missing examples)

Environment

EdgarTools Version: 5.15.0 Python Version: 3.13 Operating System: Windows 11

Bug Description

What you expected to happen: EntityFacts.discover_concept_tags() and EntityFacts.get_concept() should resolve standardized concepts (e.g., 'revenue', 'earnings_per_share_basic') for all SEC filers, including IFRS-reporting foreign private issuers (20-F filers).

What actually happened: For any company that reports using IFRS taxonomy (e.g., TSM, BBAR, SAP), discover_concept_tags() returns an empty list for every standardized concept, and get_concept() / get_revenue() / etc. all return None — despite the underlying facts data containing the correct values under ifrs-full: prefixed tags.

The root cause is in the discover_concept_tags() implementation, which only tries two variants per synonym:

for tag in group.synonyms:
    for variant in [tag, f'us-gaap:{tag}']:  # Only us-gaap prefix!
        fact = self.get_fact(variant)

It never tries ifrs-full:{tag}, so all IFRS-prefixed concepts are invisible to the standardization layer.

Error message (if any):

No error raised — methods silently return None/[] instead of finding available data.

Reproduction

Company/Ticker: TSM (Taiwan Semiconductor — IFRS filer), BBAR (BBVA Argentina — IFRS filer) Time Period: Any (all periods affected) Relevant Forms: 20-F (annual), 6-K (quarterly)

Minimal code to reproduce:

from edgar import Company

# TSM has 5,979 facts — all under ifrs-full: prefix
company = Company("TSM")
facts = company.get_facts()

# 1. discover_concept_tags returns empty for all concepts
revenue_tags = facts.discover_concept_tags('revenue')
print(f"Revenue tags: {revenue_tags}")  # → []

eps_tags = facts.discover_concept_tags('earnings_per_share_basic')
print(f"EPS tags: {eps_tags}")  # → []

ni_tags = facts.discover_concept_tags('net_income')
print(f"Net Income tags: {ni_tags}")  # → []

shares_tags = facts.discover_concept_tags('common_shares_outstanding')
print(f"Shares tags: {shares_tags}")  # → []

# 2. get_revenue() returns None
revenue = facts.get_revenue(annual=True)
print(f"Revenue: {revenue}")  # → None

# 3. But the data EXISTS — manual ifrs-full: lookup works
manual = facts.get_fact('ifrs-full:Revenue')
print(f"Manual lookup: {manual}")  # → FinancialFact with TWD 2.89T for FY2024

# Same issue with BBAR (Argentina, IFRS)
company2 = Company("BBAR")
facts2 = company2.get_facts()
revenue2 = facts2.get_revenue(annual=True)
print(f"BBAR Revenue: {revenue2}")  # → None
# BBAR revenue is under ifrs-full:InterestRevenueExpense

Additional Context

Scope of impact

All IFRS-reporting foreign private issuers on SEC EDGAR are affected. This includes major companies like:

  • TSM (Taiwan Semiconductor) — ifrs-full:Revenue
  • BBAR (BBVA Argentina) — ifrs-full:InterestRevenueExpense
  • SAP (SAP SE) — IFRS concepts
  • Any 20-F/6-K filer using IFRS taxonomy

Suggested fix

Add ifrs-full: prefix to the variant search loop in discover_concept_tags():

for tag in group.synonyms:
    for variant in [tag, f'us-gaap:{tag}', f'ifrs-full:{tag}']:  # Add IFRS prefix
        fact = self.get_fact(variant)

Additionally, the synonym groups themselves should include IFRS-specific concept names where they differ from US-GAAP. For example:

  • IFRS revenue: Revenue (same name but under ifrs-full: prefix)
  • IFRS EPS: BasicEarningsLossPerShare (different name from US-GAAP EarningsPerShareBasic)
  • IFRS net income: ProfitLoss (already in synonyms), but also ProfitLossAttributableToOwnersOfParent
  • IFRS shares: NumberOfSharesOutstanding (different from US-GAAP CommonStockSharesOutstanding)

Secondary issue: Weighted average shares

The common_shares_outstanding synonym group bundles two fundamentally different metrics:

  • CommonStockSharesOutstanding — instant (point-in-time) shares outstanding
  • WeightedAverageNumberOfSharesOutstandingBasic — duration (period-averaged) weighted shares

These have different period_type semantics and should arguably be separate standardized concepts. Additionally, diluted weighted average shares (WeightedAverageNumberOfDilutedSharesOutstanding) is missing entirely — this is the denominator for diluted EPS and is essential for financial analysis.


This issue will be handled using EdgarTools' systematic issue resolution workflow. A reproduction test will be created to verify the fix.

amcamc92 avatar Feb 10 '26 14:02 amcamc92

Classification: CRITICAL ✅

Thank you for this excellent bug report, @amcamc92. This is a CRITICAL issue that meets multiple criteria for immediate point release.

Why This Is Critical

  1. Data Accessibility Failure: The standardization layer is EdgarTools' core abstraction for financial data. For IFRS companies, it completely fails - returning None when data exists.

  2. Scope: Affects ALL IFRS-reporting foreign private issuers (hundreds of companies including major names like TSM, SAP, BBAR).

  3. Silent Failure: Worst failure mode - no error messages, just silent None returns. Users don't know if data doesn't exist or if the API is broken.

  4. Core Mission Violation: Breaks our "simple yet powerful", "accurate financials", and "beginner-friendly" principles.

Action Plan

Release Type: Point Release 5.15.2 (immediate) Timeline: 24-36 hours from now

Fix Scope:

  1. Primary: Add ifrs-full: prefix to discover_concept_tags() (line 1055 of entity_facts.py)
  2. Secondary: Update synonym groups with IFRS-specific concept names where they differ
  3. Tertiary: Address the secondary issue you raised about weighted average shares

Tracking:

  • Created Beads issue edgartools-icg4 with P0 priority
  • Added to ROADMAP.md under "Pending Point Release v5.15.2"
  • Will provide updates as implementation progresses

Your Contribution

Your bug report is exemplary:

  • ✅ Clear reproduction with multiple companies
  • ✅ Root cause identified with line numbers
  • ✅ Suggested fix with code
  • ✅ Secondary issues documented
  • ✅ Impact scope assessed

This is exactly the kind of systematic investigation that helps us maintain data quality. Thank you for taking the time to test multiple IFRS filers and document the pattern.

Next Steps

  1. Implementation will begin within 2 hours
  2. You'll see updates on this issue as we progress
  3. Point release 5.15.2 will be published within 36 hours
  4. We'll add regression tests to prevent this from recurring

dgunning avatar Feb 11 '26 02:02 dgunning

edgartools 5.15.2 has been released to address this

dgunning avatar Feb 11 '26 16:02 dgunning