Closed miguelbalmeida closed 3 months ago
I just tried adding the with streamlit_analytics.track(...)
line on the main Python file (instead of one of the page .py files) and I get the same error.
Hey @miguelbalmeida Thanks for raising the issue and providing a detailed bug report I'm going to reproduce this now and I'll follow up with findings or questions within the next hour
Intial bug analysis:
with streamlit_analytics.track
when using firestore as a backend so something is getting misplaced in the function arguments or context.Next steps:
@miguelbalmeida do you have a public repo with your pages setup that I could clone to get this exact result? It could also speed things up if I didnt have to set up firestore again
In the meantime I will logically analyze the arguments being passed within streamlit-analytics2
Thanks for the quick reply, @444B .
In the meantime, I started tinkering. I added breakpoints in the firestore.py
file to understand what was happening, hoping to hack something to prevent the error, and.......... it started working. I haven't managed to reproduce the error again. ¯_(ツ)_/¯
Is it possible that this error only appears when the Firestore counts are at zero? And the error disappears after initialization? I doubt this, because in that case others would have spotted that problem already, but it's the best explanation I could come up with.
I'm sorry I can't help further, but I am now struggling to reproduce the error myself...
No worries, I am glad to look into it as well I'm taking the opportunity to document how to set up the connection to firestore and adding it to our wiki Please let me know if you are able to reproduce the issue! Ill keep this open for the next few days
Describe the bug I have a deployed multipage Streamlit app and am trying to store the results of
streamlit-analytics2
in Google Firestore, so that they persist when the app is re-deployed. I added this line on one of the pages of the multipage app:After adding this line, when accessing the page
http://localhost:8501/<PAGE_NAME>?analytics=on
, where the analytics should be, I instead get this traceback:If I just use
with streamlit_analytics.track()
, without using Firestore as a backend, the analytics work correctly.Expected behavior
I expected the Streamlit app to show analytics as usual, and expected to see some data in the Firestore database.
To Reproduce Steps to reproduce the behavior:
with streamlit_analytics.track(firestore_key_file="...", firestore_collection_name="..."):
in one of the pageslocalhost:8501
and browse to the page with the line from step 2Software Vesions Please fill in the relevant field:
Screenshots