roost
Mmarimo
•Created by roost on 10/7/2024 in #help-support
Clearer loading signals on apps (marimo.io/p)
4 replies
Mmarimo
•Created by roost on 10/7/2024 in #help-support
SQL <> Python cell auto-conversion
problem: I was attempting to solve this issue and found that cells were automatically converting to different cell types.
Auto conversion from Python --> SQL
* To mitigate some downstream dependency issues, I first tried converting the SQL cell to python (e.g, "df_result = mo.sql(f""" query """)") , and then would save the file, and then reset the Kernel. Post kernel reset, that cell that I converted to Python was back to being a SQL file.
* I resolved this auto-conversion by making df_result local (_df_result) and then df_result = _df_result.copy().
* Even though both were outputting the same DF, the python version seemed to work more extensively for dependencies.
Auto conversion from mo.sql + Python code --> SQL
* I have data from an mo.sql outputting to a dataframe.
* This dataframe is then used in am mo.md
* Everything would be set up correctly - I would restart the kernel and the script would autorun
* Upon restart/rerun, my cells with mo.sql + Python would convert to SQL. I tried many times to have the .py cell format stick.
* To resolve this, I had to break out my mo.sql -> dataframe code (also unfortunately having to use the fix above) into a previous cell, and then display that resulting dataframe via an mo.md in the next cell.
Recommendation
Ideally, cells would not auto-convert from Python --> SQL. Some people might be more comfortable using mo.sql explicitly.
Additionally, ideally I could generate a DF with mo.sql in a cell, and also present that DF in mo.md. If this is undesired, then throwing an exception and stating this requirement would be helpful.
7 replies
Mmarimo
•Created by roost on 10/7/2024 in #help-support
SQL cells outputting data frames fail to work in dependency tree
Hello!
Problem: Following a kernel reset and full auto run, my SQL cells (not python cells) outputting a dataframe fail to work causing downstream execution issues.
* Even though my DF output cells were referenced by downstream cells, meaning they should have run in-order, some downstream cells didn't find the dataframe.
* To resolve this, I had to do an if not None statement before the downstream cells ran.
* This required that I convert other SQL cells to python cells, which is not ideal
Ideally, I could create DFs with SQL cells and the downstream dependent cells would execute at the right time.
2 replies