Skip to content

Updating to fix some errors presented in #59 - #60

Merged
tanho63 merged 5 commits into
dynastyprocess:masterfrom
mcarman8:fix-issue-59
Sep 11, 2024
Merged

tanho63 merged 5 commits into
dynastyprocess:masterfrom
mcarman8:fix-issue-59

Conversation

@mcarman8

Copy link
Copy Markdown
Contributor

Based on these duplicated results:

   mfl_id               name    dupe_id dupe_id_type
1    3298        Fred Taylor 00-0016098      gsis_id
2    8058        Fred Taylor 00-0016098      gsis_id
3    4722       Thomas Jones 00-0019641      gsis_id
4    5656       Thomas Jones 00-0019641      gsis_id
5    1286 Correll Buckhalter 00-0020270      gsis_id
6    5027 Correll Buckhalter 00-0020270      gsis_id
7    3298        Fred Taylor        333       pff_id
8    8058        Fred Taylor        333       pff_id
9    4722       Thomas Jones        585       pff_id
10   5656       Thomas Jones        585       pff_id
11   1286 Correll Buckhalter        869       pff_id
12   5027 Correll Buckhalter        869       pff_id
13  15258     Michael Carter      33495     yahoo_id
14  15432     Michael Carter      33495     yahoo_id
15  16273        Byron Young   YounBy01       pfr_id
16  16276        Byron Young   YounBy01       pfr_id

ID 8058 should not be Fred Taylor, it should be Chris Roberson a DB based on NFL draft round and position. I cannot however find him in MFL ids, including those from 2005, and from 2008 when he recorded a stat according to pro-football-reference.
The duplicate GSIS-ID and pff-id was removed for 8058, but the wrong name/mismatched mfl id still persist.
Same thing with ID 4722, based on the draft info it should be Roman Fortin, but I cannot find him in MFL reference.

1286 doesn't correspond at all. The round, position, and school don't correspond properly for the 1985 draft like the previous two did. I also removed the GSIS-ID and pff-id references since they are obviously not correct.

For ids 15258 and 15432, there are two Michael Carters, one a CB on the jets, and the other a RB on the Cardinals. Presumably they have two different yahoo ids. I don't know how to get the player list from yahoo, but that would need to be resolved to solve this issue.

The PFR id for 16723 should be YounBy00, not YounBy01. This error is not originating from this missing_ids.json file. I have added it with the intention that it force updates it to be correct, but that may not be the case.

@tanho63

tanho63 commented Sep 11, 2024

Copy link
Copy Markdown
Member

I think you mixed up 16723 vs 16273 on the YounBy01 issue, I see three of them now

@mcarman8

Copy link
Copy Markdown
Contributor Author

No, it creates an extra version of 16723 because I tried to use missing_ids.json as an override. The pipeline to link pfr id will need to be modified to fix the Byron Young Error. I just submitted a change reverting that change so we can fix the others for now.

@mcarman8

Copy link
Copy Markdown
Contributor Author

Oh my bad, I just reread what you said. All of these numbers and I read it wrong. Making the correct fix now.

@tanho63 tanho63 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread files/missing_ids.json Resolved
@tanho63

tanho63 commented Sep 11, 2024

Copy link
Copy Markdown
Member

Fixed Michael Carter yahoo id and also a stray comma preventing it from being parsed as JSON. Thanks for the assist!

x <- jsonlite::fromJSON("https://raw.githubusercontent.com/dynastyprocess/data/6dba1fd6f387cf620ea40bb9455cebe4b505544e/files/missing_ids.json")

y <- purrr::map_df(
  names(x),
  \(n) {
    x |> 
      dplyr::filter(!is.na(.data[[n]])) |> 
      dplyr::mutate(dupe_id = .data[[n]], dupe_id_type = n) |> 
      dplyr::select(mfl_id, dupe_id, dupe_id_type) |> 
      janitor::get_dupes(dupe_id, dupe_id_type) |> 
      dplyr::mutate_all(as.character) |> 
      dplyr::left_join(
        nflreadr::load_ff_playerids() |>
          dplyr::select(name, mfl_id) |>
          dplyr::mutate_all(as.character)
      ) |>
      dplyr::select(
        mfl_id, dupe_id, dupe_id_type
      )
  }
)
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type
No duplicate combinations found of: dupe_id, dupe_id_type

@tanho63
tanho63 merged commit ec3ae62 into dynastyprocess:master Sep 11, 2024
tanho63 added a commit that referenced this pull request Sep 17, 2024
* Updating to fix some errors presented in #59

* Update missing_ids.json

* Update missing_ids.json

* Update missing_ids.json

* Update files/missing_ids.json

---------

Co-authored-by: Tan Ho <38083823+tanho63@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants