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

fix(utils): use 'urllib.request' instead of 'requests' #1177

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

stormbeforesunsetbee
Copy link
Contributor

requests doesn't seem to handle TLS/SSL pretty well. It returns Forbidden when we try to get a content from an HTTPS URL such as https://query1.finance.yahoo.com/v7/finance/download/BABA?period1=1635724800&period2=1667260800&interval=1d&events=history&includeAdjustedClose=true. That's why we should use urllib.request instead.

On the other hand, I need to remove raise FileNotFoundError("Could not download resource") as urllib.request.urlopen already handle that with its HTTPError.

@codecov-commenter
Copy link

Codecov Report

Base: 90.44% // Head: 90.46% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (2728f7d) compared to base (47d3aeb).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1177      +/-   ##
===========================================
+ Coverage    90.44%   90.46%   +0.01%     
===========================================
  Files          181      181              
  Lines         5516     5514       -2     
===========================================
- Hits          4989     4988       -1     
+ Misses         527      526       -1     
Flag Coverage Δ
py3.8-ubuntu-latest-pandas 90.46% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pandas_profiling/utils/cache.py 100.00% <100.00%> (+3.84%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fabclmnt fabclmnt merged commit 37867a4 into ydataai:develop Nov 28, 2022
vascoalramos added a commit that referenced this pull request Nov 28, 2022
* chore(actions): add semantic pr validation and only add changelog on new releases (#1168)

* fix(utils): use 'urllib.request' instead of 'requests'

Co-authored-by: Vasco Ramos <vasco.ramos@ydata.ai>
@stormbeforesunsetbee
Copy link
Contributor Author

@aquemy Sorry, haven't take a look at those

vascoalramos added a commit that referenced this pull request Nov 29, 2022
* chore(actions): add semantic pr validation and only add changelog on new releases (#1168)

* fix(utils): use 'urllib.request' instead of 'requests'

Co-authored-by: Vasco Ramos <vasco.ramos@ydata.ai>
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.

None yet

5 participants