Back to Community
fetch_csv() issue, Published csv Google Sheet Unaccessible

Hi,

I have issues in getting published google csv file using fetch_csv(). It has been working fine for a long time until recently. Every sheet that I used to be able to access has an error message like below. What does it mean when it says "from a redirected url"?

"""

LoadCSVRedirect: 0065 Attempt to fetch_csv from a redirected url.
https://docs.google.com/spreadsheets/d/e/2PACX-1vTqvRexaufUgjjmrc-RUZ-llIo85xR69-T1suGZt4az4eWjKCc_VQeqfuvmAFlEGn3XqDUfNCCGd90A/pub?output=csv
must be changed to https://doc-0s-80-sheets.googleusercontent.com/pub/l5l039s6ni5uumqbsj9o11lmdc/7p8u4u4ov9k25encoidjibbct0/1593314920000/116614430574839741191/*/[email protected]_VQeqfuvmAFlEGn3XqDUfNCCGd90A?output=csv

"""

I'm simply using the following commend to get the csv, but it just fails with the above message.

url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vTqvRexaufUgjjmrc-RUZ-llIo85xR69-T1suGZt4az4eWjKCc_VQeqfuvmAFlEGn3XqDUfNCCGd90A/pub?output=csv'

fetch_csv(url,  
        date_column='Date',  
        date_format='%Y-%m-%d',  
        symbol='breadth',  
        usecols = ['Breadth_Strength'],  
        )  

Does anyone has similar issues? Is it a google issue or not? What is the solution for this?

9 responses

Did you try the url that is supplied by the error?

I did. It did not work either.

having the same issue. any fix for this?

Sorry about the issue loading docs from Google. Looking into this but no info yet. Will reply when we know more.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Looks like this is a change that Google made recently where the published URL is being re-directed. The Quantopian fetch_csv method doesn't support re-directed URLs. We are looking into a fix but can't promise anything at the moment. One solution would be to use a different host such as dropbox (if that's possible).

I would love this issue to be solved. Google sheet is so convenient because I can access and update it from multiple locations/machines.

Dropbox does not provide public url anymore.

Not sure we will be able to fix this after Google changed their public URLs. Engineering is looking into it but no promises. Really a much better, and better supported, approach would be to use self serve data instead of fetch_csv. This does support the latest Google change. Probably a good time to make the switch. Take a look at the docs https://www.quantopian.com/docs/user-guide/tools/self-serve.

Dan,

Per Quantopian document:

Self-Serve Data currently only supports uploading custom datasets that are mapped to US equities.

My private dataset is for some custom signals. It is not about the price of any equities. Can Self-Serve Data still work?

The Self serve data without access to symbols community post shows how to work around data that doesn't map to a single asset. Basically you can map your data to a single asset (like SPY) and broadcast that value in pipeline via the examples given.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.