-
Notifications
You must be signed in to change notification settings - Fork 3
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
Panic if ticker not available #79
Comments
d3an
added a commit
that referenced
this issue
Jan 13, 2022
### Change to Function Signature `GetQuotes` now returns `(Results, error)`. The error here should either be `nil` or `fmt.Errorf("error failed to generate rows from quote KVP map")`. `Results` is constructed as `Results{Data: *dataframe.DataFrame, Warnings: []Warning, Errors: []Error}`. As follows: - `Data` is the previously returned DataFrame - `Warnings` is a slice of new `Warning` structs. An example `Warning` is given by `Warning{Ticker: "INVALID", Error: fmt.Errorf("resource not found")}`. Right now, warnings only indicate that Finviz does not support the given ticker. - `Errors` is a slice of new `Error` structs. An example `Error` is given by `Error{Ticker: "SNAP", Error: fmt.Errorf(...)}`. Errors could occur if Finviz has placed you on a block list (usually done via Cloudflare) or could be an internal library error. If a Warning or Error exists for a Ticker, then the returned DataFrame will not have a row for that Ticker. The three sets, i.e., Data, Warnings, and Errors, are mutually exclusive. ### Other Changes - Added `Exchange` column to returned DataFrame. - Fixed a bug that sometimes returned `S&P,500` as a stock's Index; now returns `S&P500`. - Added data cleaning to DataFrame results, i.e., most columns should now correspond to their actual data type. - Added support for backoff algorithm on request frequency. Closes #78, #79
Read about the changes here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am requesting quotes
client.GetQuotes([]symbols)
for a bunch of tickers and getpanic
if a ticker is not available in FinViz, e.g. tickerSHAC
is not..error received while scraping quote for 'SHAC': error getting url: 'https://finviz.com/quote.ashx?t=SHAC&ty=c&p=d&b=1', status code: '404'
I could catch the
error
, remove the ticker and pull again, but that could be much overhead, specially from FinViz point of view. Could this be fixed internally so the program does not panic but throws warning instead that a ticker is not available?The text was updated successfully, but these errors were encountered: