Pandas data reader when using get_data_tiingo with an API throws an exception when used on streamlit cloud

It throws error exactly on this line : pdr.get_data_tiingo(ticker_sym, api_key = api)

ERROR :
return pd.concat(dfs, self._concat_axis)
TypeError: concat() takes 1 positional argument but 2 were given

I think this is an internal module error but it’s working fine outside of streamlit and even works on local hosted streamlit.

Take a look at the docs for pandas.concat.

It’s an update in concat() function to use objs as a keyword argument to specify any series or data Frame, But the internal working of get_data_tiingo hasn’t updated according to it!
I cannot manipulate it externally! Maybe we could try to reach out to maintainer’s of this module?

Ah, I see. It is axis what has become a keyword-only argument. Latest pandas-datareader was released almost two years ago and there has been no development activity in the repository for more than a year. So good luck with your bug report. You did the right thing anyway.

You can fork the repo and fix it yourself, or extract the relevant code and add it to your own codebase. And this is python, you can manipulate almost everything. I bet you could make it work using unittest.patch(). That would be extremely hacky, though.

I’d rather find an alternative way to get Tiigo data.

Oh I didn’t knew abt the manipulation part, Thanks for the info I’m definitely looking for an alternative

What if I use an older version of pandas in my requirements.txt which doesn’t include that update, It does seems to be a feasible solution

That should also work as a short term solution.

I forked the original repo and changed it accordingly then used URL of my forked repo to include into requirements.txt
Amazingly this worked, Thanks again for your assistance

1 Like