Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix bigint parsing (#882)

Akshay Agrawal302fd6c5d22e
diff --git a/frontend/src/plugins/impl/vega/loader.ts b/frontend/src/plugins/impl/vega/loader.ts
index cd7fa85627..52c8592284 100644
--- a/frontend/src/plugins/impl/vega/loader.ts
+++ b/frontend/src/plugins/impl/vega/loader.ts
@@ -12,7 +12,18 @@ const bigIntIntegerParser = (v: string) => {
if (v === "") {
return "";
}
- return isNumber(Number.parseInt(v)) ? BigInt(v) : "";
+
+ if (isNumber(Number.parseInt(v))) {
+ try {
+ return BigInt(v);
+ } catch {
+ // Floats like 2.0 are parseable as ints but not
+ // as BigInt
+ return previousIntegerParser(v);
+ }
+ } else {
+ return "";
+ }
};
function enableBigInt() {
diff --git a/marimo/_smoke_tests/bugs/881.py b/marimo/_smoke_tests/bugs/881.py
new file mode 100644
index 0000000000..a51823cfdd
--- /dev/null
+++ b/marimo/_smoke_tests/bugs/881.py
@@ -0,0 +1,17 @@
+import marimo
+
+__generated_with = "0.2.12"
+app = marimo.App()
+
+
+def __():
+ import pandas as pd
+ import marimo as mo
+ df = pd.DataFrame({"data": [2.0]})
+ mo.ui.table(df)
+ return df, mo, pd
+
+
+if __name__ == "__main__":
+ app.run()