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

feat(vax,chn): Reduce running time and still ensure data validity #2620

Merged
merged 3 commits into from
Apr 29, 2022

Conversation

aywi
Copy link
Contributor

@aywi aywi commented Apr 29, 2022

See the title.

try:
record = self._parse_data_complete(driver, link)
except:
print("Failed to parse:", link)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know whether "print" is a right statement to use in this project when I want to output an acceptable error.

Copy link
Member

Choose a reason for hiding this comment

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

If we want the pipeline to be aware that something is not working for a country, we simply raise Exceptions.

So here I would use

except:
  raise Exception(f"Failed to parse {link}")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lucasrodes Thanks! Since the only possible exception in the subroutine is TimeoutException (in two different locations), I will cancel the try-except and let them happen in the subroutine. See #2621.

@lucasrodes
Copy link
Member

LGTM - working! Thanks @aywi

@lucasrodes lucasrodes merged commit 5cbf0f9 into owid:master Apr 29, 2022
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