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

game_type_rules lookup fails due to incorrect ID being supplied in the draft group object #113

Open
triviski opened this issue Apr 30, 2022 · 0 comments

Comments

@triviski
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant