Skip to content

fix: FastFlightsAdapter fails silently on domestic Indian routes (INR currency + string stops) #31

@KrishnaRaheja

Description

@KrishnaRaheja

Describe the bug

For domestic Indian flight searches (e.g. BOM→DEL, DEL→BOM), the FastFlightsAdapter returns 0 results despite receiving raw flight data from the API (e.g. 533 raw responses → 0 parsed). All flights are silently dropped inside the per-flight error recovery loop.

Root cause (two bugs in _process_flights):

  1. String stops field — The fast_flights library returns flight.stops as a string ("Nonstop", "1 stop") for domestic Indian routes instead of an integer. The comparison flight.stops > max_stops raises TypeError: '>' not supported between instances of 'str' and 'int', causing every flight to be caught and skipped.

  2. INR price parsing_parse_price only strips $ and ,. Indian rupee prices formatted as "₹5,000" fail float() conversion with ValueError, returning 0.0 for all domestic flights (silent data loss — prices recorded as $0).


To Reproduce

Search for any domestic Indian route, e.g.:

  • BOM → DEL, 2026-05-01, economy, max_stops=0
  • DEL → BOM, 2026-05-04, economy, max_stops=0

Expected behavior

Flights are parsed and returned with either the correct INR-converted price or a raw INR amount stored with currency metadata.


Actual behavior

Found 0 unique flights (533 total raw responses) — all flights silently dropped.


Affected code

  • fast_flights_adapter.py:236flight.stops > max_stops (no int coercion)
  • fast_flights_adapter.py:317-318_parse_price only handles $

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions