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

Build fail: KeyError 'MIM Number' #106

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Build fail: KeyError 'MIM Number' #106

merged 1 commit into from
Oct 15, 2023

Conversation

joeflack4
Copy link
Contributor

@joeflack4 joeflack4 commented Oct 15, 2023

Updates

  • Bugfix: KeyError 'MIM Number'.

@joeflack4 joeflack4 added the bug Something isn't working label Oct 15, 2023
@joeflack4 joeflack4 self-assigned this Oct 15, 2023
@joeflack4 joeflack4 marked this pull request as draft October 15, 2023 21:03
try:
df = pd.read_csv(input_path, delimiter='\t', comment='#').fillna('')
df[mim_col] = df[mim_col].astype(int) # these were being read as floats
# TODO: Need a better solution than this. Which should be: When these files are downloaded, should uncomment header
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue

I'm not sure why this suddenly started happening, where the header is missing from the files. This is what is causing the KeyError causing the action to fail.

The solution

The best way to fix this would be to do things at download time for all the files. But in the interest of time, I fixed it at the point of failure.
Need a better solution than this. Which should be: When these files are downloaded, should uncomment header

Copy link
Member

Choose a reason for hiding this comment

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

What issue is this solving? Sorry I was in a big hole, but getting back to life now!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's all right. Thanks for checking in on this. I wanted more time to look more deeply into the root cause and fix the issue upstream in a better way, but basically I did a quick fix.

Basically what's happening is that when the TSVs are downloaded, there are a few comment lines, including the header is commented out. So we do a special operation to uncomment that header . For some reason it suddenly it wasn't getting uncommented

@joeflack4 joeflack4 marked this pull request as ready for review October 15, 2023 21:34
@joeflack4 joeflack4 merged commit f8f947a into main Oct 15, 2023
1 check passed
@joeflack4 joeflack4 deleted the bugfix-keyerr-mimnum branch October 15, 2023 21:52
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

Successfully merging this pull request may close these issues.

2 participants