[Python] How specifically request rows with null values through an API request

Discussão em 'Python' iniciado por Stack, Março 14, 2025.

  1. Stack

    Stack Membro Participativo

    This is in the context of a Python API. I have a column where the value can be either True, False or Null, lets call it is_impounded. The Null "value" is when it is unknown whether it is impounded or not.

    I want to be able to pass a query parameter in a GET request which gets all rows where it is unknown whether the car is impounded. I cant pass GET /cars?is_impounded=None because that is the same as GET /cars which returns ALL rows. My other thought was to use the strings 'yes' 'no' 'unknown' as the column value and then query GET /cars?is_impounded=unknown. But that just seems a bit odd.

    Has anyone had this issue before and how did you resolve it?

    Continue reading...

Compartilhe esta Página