Description
Yo, first I really like your tool.
I believe I found a bug that is based on an incorrect assumption. I am trying to get contests and then look up game rules using the draft group contest_type_id. This has always worked but I was trying it today for MLB and it was giving a "Game Type Not Found" error.
If you look at the URLs I provide you will see that for most of the contests DraftGroups the ContestTypeId and the GameTypeId are the same. However, I have found one in MLB that they are different and the call to get the game types fails.
PYTHON CODE THAT FAILS (Initialized for MLB):
self.client.game_type_rules(28)
You can check the draft group 68014 and see the ContestTypeId is 28 but the GameTypeId is 2. I will paste the snippets just in case this is and edge case and it clears up after this contest concludes.
{
"DraftGroupId": 68014,
"ContestTypeId": 28,
"StartDate": "2022-04-30T23:05:00.0000000Z",
"StartDateEst": "2022-04-30T19:05:00.0000000",
"SortOrder": 999,
"DraftGroupTag": "Featured",
"GameTypeId": 2,
"GameType": null,
"SportSortOrder": 1,
"Sport": "MLB",
"GameCount": 7,
"ContestStartTimeSuffix": null,
"ContestStartTimeType": 0,
"Games": null,
"DraftGroupSeriesId": 0,
"GameSetKey": "DCADFF91E88F70194E0FA9086EB3C152",
"AllowUGC": true
},
Failed Lookup: https://api.draftkings.com/lineups/v1/gametypes/28/rules?format=json
{
"gameTypeId": 0,
"gameTypeName": null,
"gameTypeDescription": null,
"lineupConfigurationId": 0,
"salaryCap": null,
"gameCount": null,
"teamCount": null,
"uniquePlayers": false,
"allowLateSwap": false,
"lineupTemplate": null,
"errorStatus": {
"code": "HOY101",
"developerMessage": "Game Type Not Found"
},
"rulesUrl": null,
"draftType": null,
"allowedCompetitionAttributes": null,
"scoringDivider": null,
"useOptimalLineups": false,
"supportsPlayersTab": false,
"showByeWeekInfo": false,
"glossaryTerms": null,
"originalDraftType": null,
"isSeasonLong": false,
"errorCodes": null
}
Successful lookup: https://api.draftkings.com/lineups/v1/gametypes/2/rules?format=json
{I don't want to paste, it just looks normal here.}
I attempted to make a change with the intention to do a pull request but I could not get it to work. I am going to deal with a workaround but I think this would be a good thing to fix. I think just adding the gameTypeId to the contest draft group objects is the way to go, but obviously this is not my deal.
Thanks again.