edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

FactQuery.by_value() misses exact text matches

Open joshhheo opened this issue 2 weeks ago • 0 comments

Issue Type

  • [x] XBRL Parsing Issue (statement rendering, concept mapping)

Environment

EdgarTools Version: 6.2.0 package metadata, reproduced on main at commit e2cc982e
Python Version: 3.15.2
Operating System: macOS 15.1

Bug Description

What you expected to happen

An exact text search with by_value("10-Q") should return the dei:DocumentType fact when its value is "10-Q".

What actually happened

The query finds the fact by concept and shows its value as "10-Q". Adding .by_value("10-Q") returns an empty list.

Error message

No exception is raised.

Reproduction

Company/Ticker: Tesla (TSLA)
Time Period: Quarter ended June 30, 2024
Relevant Form: 10-Q, accession 0001628280-24-032662

Run this from the EdgarTools repo root. It uses the saved Tesla filing fixture.

from edgar.xbrl import XBRL

xbrl = XBRL.from_directory("tests/fixtures/xbrl/tsla")
query = xbrl.query().by_concept("dei:DocumentType", exact=True)

print([fact["value"] for fact in query.execute()])  # ['10-Q']
print(query.by_value("10-Q").execute())  # [] (expected one match)

Additional Context

by_value() accepts a string, but its exact-match branch checks numeric_value. For this fact, numeric_value is None and value contains "10-Q".

SEC filing

joshhheo avatar Nov 18 '26 09:11 joshhheo