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.

Documentation Bugfix: Polars cannot read json from URL (#9397)

Daniel Bogdolle89912c827c7
diff --git a/docs/guides/working_with_data/dataframes.md b/docs/guides/working_with_data/dataframes.md
index ea7564c65a..357fab0091 100644
--- a/docs/guides/working_with_data/dataframes.md
+++ b/docs/guides/working_with_data/dataframes.md
@@ -47,10 +47,12 @@ df
```python
import polars as pl
+import urllib.request
-df = pl.read_json(
-"https://raw.githubusercontent.com/vega/vega-datasets/master/data/cars.json"
-)
+url = "https://raw.githubusercontent.com/vega/vega-datasets/master/data/cars.json"
+
+with urllib.request.urlopen(url) as response:
+ df = pl.read_json(response.read())
df
```