Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(nomination nominees): returns 500 get() returned more than one NominationPosition -- it returned 2! #251

Open
ryparker opened this issue Jun 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ryparker
Copy link
Contributor

ryparker commented Jun 6, 2024

Requesting the nomination 2691 of the 117th congress return a 500 error:

curl --location 'https://api.congress.gov/v3/nomination/117/2691/1?format=json&limit=250&offset=0&api_key=<API_KEY>'

Response 500:

{
    "error": "get() returned more than one NominationPosition -- it returned 2!\n    query was: (), {\n 'ordinal': '1'} (MultipleObjectsReturned)",
    "request": {
        "congress": "117",
        "contentType": "application/json",
        "format": "json",
        "number": "2691"
    }
}

This also occurred with the following

117th congress:
- nomination 1220, ordinal 1
115th congress:
- nomination 2473, ordinal 1
- nomination 2633, ordinal 1
@apreiter18 apreiter18 added the bug Something isn't working label Jun 6, 2024
@apreiter18
Copy link
Collaborator

Hi @ryparker - I am doing some digging into these two examples you cited. A few things:

  1. The "/1" at the end of these calls would suggest they are partitioned nominations, which they are not. If you try https://api.congress.gov/v3/nomination/117/1220?format=json&limit=250&offset=0&api_key=INSERTKEY you should get data returned (same for 117 PN 1220).
  2. I think that there is something wrong with the referrer URL in the above calls, though, so I need to submit an investigation ticket here.

Please feel free to report any other items in this Git issue. Thank you!

@ryparker
Copy link
Contributor Author

ryparker commented Jun 6, 2024

The "/1" at the end of these calls would suggest they are partitioned nominations, which they are not. If you try api.congress.gov/v3/nomination/117/1220?format=json&limit=250&offset=0&api_key=INSERTKEY you should get data returned (same for 117 PN 1220).

Ah looks like that was an error on my side. Thanks.

@ryparker
Copy link
Contributor Author

ryparker commented Jun 6, 2024

Actually this seems to be an error when querying nomination nominees.

Request the details of the nomination:

curl --location 'https://api.congress.gov/v3/nomination/117/2691?api_key=<API_KEY>'

Returns a list of 3 nominees, 2 of them have the same ordinal of 1

{
    "nomination": {
        "actions": {
            "count": 4,
            "url": "https://api.congress.gov/v3/nomination/117/2691/actions?format=json"
        },
        "authorityDate": "2022-12-08",
        "citation": "PN2691",
        "committees": {
            "count": 1,
            "url": "https://api.congress.gov/v3/nomination/117/2691/committees?format=json"
        },
        "congress": 117,
        "isList": true,
        "latestAction": {
            "actionDate": "2022-12-08",
            "text": "Confirmed by the Senate by Voice Vote."
        },
        "nominees": [
            {
                "introText": "THE FOLLOWING NAMED OFFICERS OF THE COAST GUARD PERMANENT COMMISSIONED TEACHING STAFF FOR APPOINTMENT IN THE UNITED STATES COAST GUARD TO THE GRADE INDICATED UNDER TITLE 14, U.S.C., SECTIONS 1944 AND 2126:",
                "nomineeCount": 3,
                "ordinal": 2,
                "organization": "Coast Guard",
                "positionTitle": "Commander",
                "url": "https://api.congress.gov/v3/nomination/117/2691/2?format=json"
            },
            {
                "introText": "THE FOLLOWING NAMED OFFICERS OF THE COAST GUARD PERMANENT COMMISSIONED TEACHING STAFF FOR APPOINTMENT IN THE UNITED STATES COAST GUARD TO THE GRADE INDICATED UNDER TITLE 14, U.S.C., SECTIONS 1944 AND 2126:",
                "nomineeCount": 3,
                "ordinal": 1,
                "organization": "Coast Guard",
                "positionTitle": "COMMANDER",
                "url": "https://api.congress.gov/v3/nomination/117/2691/1?format=json"
            },
            {
                "introText": "THE FOLLOWING NAMED OFFICERS OF THE COAST GUARD PERMANENT COMMISSIONED TEACHING STAFF FOR APPOINTMENT IN THE UNITED STATES COAST GUARD TO THE GRADE INDICATED UNDER TITLE 14, U.S.C., SECTIONS 1944 AND 2126:",
                "nomineeCount": 2,
                "ordinal": 1,
                "organization": "Coast Guard",
                "positionTitle": "Captain",
                "url": "https://api.congress.gov/v3/nomination/117/2691/1?format=json"
            }
        ],
        "number": 2691,
        "partNumber": "00",
        "receivedDate": "2022-10-11",
        "updateDate": "2023-10-13T12:38:59Z"
    },
    "request": {
        "congress": "117",
        "contentType": "application/json",
        "format": "json",
        "number": "2691"
    }
}

Then when you request the duplicated ordinal 1, then the API returns 500:

curl --location 'https://api.congress.gov/v3/nomination/117/2691/1?format=json&limit=250&offset=0&api_key=<API_KEY>'

Response:

{
    "error": "get() returned more than one NominationPosition -- it returned 2!\n    query was: (), {\n 'ordinal': '1'} (MultipleObjectsReturned)",
    "request": {
        "congress": "117",
        "contentType": "application/json",
        "format": "json",
        "number": "2691"
    }
}

Same scenario for 1220, with ordinal 1, in 117th congress

@ryparker ryparker changed the title (nomination): returns 500 get() returned more than one NominationPosition -- it returned 2! (nomination nominees): returns 500 get() returned more than one NominationPosition -- it returned 2! Jun 6, 2024
@apreiter18 apreiter18 added this to the Near term backlog milestone Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants