Skip to content

Conversation

@ValueRaider
Copy link
Collaborator

@ValueRaider ValueRaider commented Jan 28, 2023

proxy argument 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

@ValueRaider
Copy link
Collaborator Author

@ricardoprins Start your proxy testing here.

@mar-galho
Copy link
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 None

test 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

@mar-galho
Copy link
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 None

test 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

Copy link
Contributor

@mar-galho mar-galho left a 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.

@ValueRaider ValueRaider merged commit 1bd819a into main Jul 21, 2023
@ValueRaider ValueRaider deleted the hotfix/proxy branch July 21, 2023 11:58
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.

No data found for this date range, symbol may be delisted(July 26th,2022): But, it works again now

4 participants