OpenBB-finance/OpenBB · warning · HTTPException
No text available for this amendment currently.
Error message
No text available for this amendment currently.
What it means
get_amendment_text gathers text from up to three sources — the amendment's own textVersions, an associated committee report, and the parent bill's textVersions (fetched only when bill_url is given, with its exceptions swallowed). If all are empty and is_workspace=False, HTTPException(404) is raised. Like the bill-text twin, this mostly means GPO has not published text for the amendment yet.
Source
Thrown at openbb_platform/providers/congress_gov/openbb_congress_gov/utils/helpers.py:841
# Step 4: If no text versions found, fall back to the amended bill's text versions.
bill_text_versions: list = []
if not text_versions and not committee_report_text:
amended_bill = amendment_detail.get("amendedBill", {})
bill_url = amended_bill.get("url", "") if amended_bill else ""
if bill_url:
bill_text_url = bill_url.replace("?", "/text?") + f"&api_key={api_key}"
try:
bill_tv_response: dict = await amake_request(bill_text_url) # type: ignore
bill_text_versions = bill_tv_response.get("textVersions", [])
except Exception: # pylint: disable=broad-except # noqa: S110
pass
if is_workspace is False:
if not text_versions and not committee_report_text and not bill_text_versions:
raise HTTPException(
status_code=404,
detail="No text available for this amendment currently.",
)
text_output: list = []
seen_pdf_urls: set = set()
def _deduped_entry(entry: dict, formats: list) -> dict | None:
pdf_url = next(
(f.get("url") for f in formats if f.get("type") == "PDF"), None
)
if pdf_url and pdf_url in seen_pdf_urls:
return None
if pdf_url:
seen_pdf_urls.add(pdf_url)
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Catch 404 and surface 'text not yet published' as a normal state
- Pass bill_url when you have it, so the parent-bill fallback can find text
- Retry after 24-48h for newly offered amendments
Example fix
# before
text = await get_amendment_text(amendment_url=u, is_workspace=False)
# after
try:
text = await get_amendment_text(amendment_url=u, bill_url=parent_bill, is_workspace=False)
except HTTPException as e:
if e.status_code == 404:
text = [] # no text published yet
else:
raise Defensive patterns
Strategy: try-catch
Validate before calling
def amendment_text_inputs_ready(amendment_url: str, bill_url: str | None) -> bool:
return bool(amendment_url) # pass bill_url too to enable the fallback source Try / catch
from fastapi import HTTPException
async def safe_amendment_text(amendment_url: str, bill_url: str | None = None) -> list:
try:
return await get_amendment_text(amendment_url=amendment_url, bill_url=bill_url, is_workspace=False)
except HTTPException as e:
if e.status_code == 404:
return [] # no text published yet
raise Prevention
- Always pass bill_url when available — it is the fallback text source
- Treat 404 as a normal 'not yet published' state for fresh amendments
- Retry next day for recently offered amendments
When it happens
Trigger: A recently offered amendment whose text is not yet on GPO; amendments that only exist as committee-report text with report_url absent; bill_url not passed, so the parent-bill fallback never runs.
Common situations: Dashboards deep-linking from amendment lists to text; amendment records whose text lives only in the linked bill but the bill_url field was dropped upstream.
Related errors
- No text available for this bill currently.
- Bill URL is required. Please provide a valid bill URL or num
- Amendment URL is required. Please provide a valid amendment
- Committee system code is required.
- Invalid bill type: {bill_type}. Must be one of {', '.join([o
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/c8013d1c75e5cc4e.
Report an issue: GitHub.