-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix proxy arg passthrough #1371
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: "Yahoo web request for share count failed" updated cache_get call by adding proxy parameter and by calling it by keyword
get_shares_full does not work with proxy
Collaborator
Author
|
@ricardoprins Start your proxy testing here. |
Contributor
|
This fixes #1399. Going to check the other open issues. def test_ticker_with_proxy(self):
proxy = 'http://xxx.xxx.xxx.xxx:xxxxx' (address omitted on purpose here)
ticker = yf.Ticker('AAPL')
isin = ticker.get_isin(proxy)
assert isin is not Nonetest results: Testing started at 2:56 PM ...
Launching unittests with arguments python -m unittest test_yfinance.TestTicker.test_ticker_with_proxy in xxxxx
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): query2.finance.yahoo.com:443
DEBUG:urllib3.connectionpool:https://query2.finance.yahoo.com:443 "GET /v6/finance/quoteSummary/AAPL?modules=financialData&modules=quoteType&modules=defaultKeyStatistics&modules=assetProfile&modules=summaryDetail&ssl=true HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): query1.finance.yahoo.com:443
DEBUG:urllib3.connectionpool:https://query1.finance.yahoo.com:443 "GET /ws/fundamentals-timeseries/v1/finance/timeseries/AAPL?symbol=AAPL&type=trailingPegRatio&period1=1673913600&period2=1689724800 HTTP/1.1" 200 247
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): markets.businessinsider.com:443
DEBUG:urllib3.connectionpool:https://markets.businessinsider.com:443 "GET /ajax/SearchController_Suggest?max_results=25&query=Apple%20Inc. HTTP/1.1" 200 3817
Ran 1 test in 1.733s
OK
|
Contributor
|
This fixes #1386: def test_download_with_proxy(self):
proxy = 'http://xxx.xxx.xxx.xxx:xxxxx' # (address omitted on purpose here)
download = yf.download('AAPL', proxy=proxy)
assert download is not Nonetest results: Testing started at 2:57 PM ...
Launching unittests with arguments python -m unittest test_yfinance.TestTicker.test_download_with_proxy in xxxxx
DEBUG:yfinance:Entering download()
DEBUG:yfinance:Disabling multithreading because DEBUG logging enabled
DEBUG:yfinance: Entering history()
DEBUG:yfinance:AAPL: Yahoo GET parameters: {'period1': '1899-12-31 17:24:11-04:56', 'period2': '2023-07-18 16:57:46-04:00', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): query2.finance.yahoo.com:443
DEBUG:urllib3.connectionpool:https://query2.finance.yahoo.com:443 "GET /v8/finance/chart/AAPL?period1=-2208994789&period2=1689713866&interval=1d&includePrePost=False&events=div%2Csplits%2CcapitalGains HTTP/1.1" 200 None
DEBUG:yfinance:AAPL: yfinance received OHLC data: 1980-12-12 14:30:00 -> 2023-07-18 20:00:04
DEBUG:yfinance:AAPL: OHLC after cleaning: 1980-12-12 09:30:00-05:00 -> 2023-07-18 16:00:04-04:00
DEBUG:yfinance:AAPL: OHLC after combining events: 1980-12-12 00:00:00-05:00 -> 2023-07-18 00:00:00-04:00
DEBUG:yfinance:AAPL: yfinance returning OHLC: 1980-12-12 00:00:00-05:00 -> 2023-07-18 00:00:00-04:00
DEBUG:yfinance: Exiting history()
DEBUG:yfinance:Exiting download()
Ran 1 test in 0.662s
OK
|
mar-galho
approved these changes
Jul 18, 2023
Contributor
mar-galho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that this has solved the proxy issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
proxyargument was broken in recent versions, this should fix it.Fixes #998 #1282 #1386 #437 #213, and maybe #1387 (were they using proxy?)
Status
Ticker.isin()doesn't work with proxy, can someone with a proxy help investigate? #1399