Skip to content

hasImages parameter acts odd due to Python having upper-case Booleans` #48

@HStep20

Description

@HStep20

I was making some request calls to the 'search' endpoint to get some information about paintings, and noticed some very odd behavior regarding the hasImages field. When encoding data via the requests library, the upper case 'T' in 'True' causes issues with the case sensitive nature of the hasImages field. You can see here that there is quite a large difference between manually encoding data and letting the library encode that data for you

Manual Encoding (12111 results):

object_ids_large = session.get(BASE_URL+"/search?hasImages=true&medium=Paintings&q=%22%22").json()

Requests Library Encoding (228 results):

object_ids_small = session.get(BASE_URL+"/search", params={ "hasImages" : True, "medium" : "Paintings","q":""}).json()

I had tried using a string in my params (passing "true"), but that returned 0 results, so however this boolean is interpreted on the backend query behaves strange across languages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions