diff --git a/ibis/backends/bigquery/client.py b/ibis/backends/bigquery/client.py index a371cc4c2421..fcd754bfc491 100644 --- a/ibis/backends/bigquery/client.py +++ b/ibis/backends/bigquery/client.py @@ -195,7 +195,7 @@ def parse_project_and_dataset(project: str, dataset: str = "") -> tuple[str, str 'ibis-gbq' >>> dataset 'my_dataset' - >>> data_project, billing_project, _ = parse_project_and_dataset("ibis-gbq") + >>> data_project, billing_project, _dataset = parse_project_and_dataset("ibis-gbq") >>> data_project 'ibis-gbq' """ diff --git a/ibis/backends/duckdb/__init__.py b/ibis/backends/duckdb/__init__.py index 41e673f56b1d..21885edbd982 100644 --- a/ibis/backends/duckdb/__init__.py +++ b/ibis/backends/duckdb/__init__.py @@ -747,10 +747,13 @@ def read_sqlite(self, path: str | Path, table_name: str | None = None) -> ir.Tab >>> import sqlite3 >>> ibis.options.interactive = True >>> with sqlite3.connect("/tmp/sqlite.db") as con: - ... _ = con.execute("DROP TABLE IF EXISTS t") - ... _ = con.execute("CREATE TABLE t (a INT, b TEXT)") - ... _ = con.execute("INSERT INTO t VALUES (1, 'a'), (2, 'b'), (3, 'c')") + ... con.execute("DROP TABLE IF EXISTS t") # doctest: +ELLIPSIS + ... con.execute("CREATE TABLE t (a INT, b TEXT)") # doctest: +ELLIPSIS + ... con.execute( + ... "INSERT INTO t VALUES (1, 'a'), (2, 'b'), (3, 'c')" + ... ) # doctest: +ELLIPSIS ... + <...> >>> con = ibis.connect("duckdb://") >>> t = con.read_sqlite("/tmp/sqlite.db", table_name="t") >>> t @@ -798,10 +801,13 @@ def attach_sqlite( >>> import ibis >>> import sqlite3 >>> with sqlite3.connect("/tmp/attach_sqlite.db") as con: - ... _ = con.execute("DROP TABLE IF EXISTS t") - ... _ = con.execute("CREATE TABLE t (a INT, b TEXT)") - ... _ = con.execute("INSERT INTO t VALUES (1, 'a'), (2, 'b'), (3, 'c')") + ... con.execute("DROP TABLE IF EXISTS t") # doctest: +ELLIPSIS + ... con.execute("CREATE TABLE t (a INT, b TEXT)") # doctest: +ELLIPSIS + ... con.execute( + ... "INSERT INTO t VALUES (1, 'a'), (2, 'b'), (3, 'c')" + ... ) # doctest: +ELLIPSIS ... + <...> >>> con = ibis.connect("duckdb://") >>> con.list_tables() [] diff --git a/ibis/expr/api.py b/ibis/expr/api.py index 30f2fa35b958..3c91d24bfdbd 100644 --- a/ibis/expr/api.py +++ b/ibis/expr/api.py @@ -1058,7 +1058,7 @@ def read_csv( ... ,f ... ''' >>> with open("/tmp/lines.csv", mode="w") as f: - ... _ = f.write(lines) + ... nbytes = f.write(lines) # nbytes is unused ... >>> t = ibis.read_csv("/tmp/lines.csv") >>> t @@ -1114,7 +1114,7 @@ def read_json( ... {"a": null, "b": "f"} ... ''' >>> with open("/tmp/lines.json", mode="w") as f: - ... _ = f.write(lines) + ... nbytes = f.write(lines) # nbytes is unused ... >>> t = ibis.read_json("/tmp/lines.json") >>> t diff --git a/ibis/expr/types/relations.py b/ibis/expr/types/relations.py index a012b0df00ce..36451f25664d 100644 --- a/ibis/expr/types/relations.py +++ b/ibis/expr/types/relations.py @@ -2379,7 +2379,7 @@ def unpack(self, *columns: str) -> Table: ... {"name": "c", "pos": {"lat": 10.3, "lon": 30.1}} ... ''' >>> with open("/tmp/lines.json", "w") as f: - ... _ = f.write(lines) + ... nbytes = f.write(lines) # nbytes is unused ... >>> t = ibis.read_json("/tmp/lines.json") >>> t diff --git a/ibis/expr/types/temporal.py b/ibis/expr/types/temporal.py index e93a3bb29cc2..27a460103ac6 100644 --- a/ibis/expr/types/temporal.py +++ b/ibis/expr/types/temporal.py @@ -291,7 +291,7 @@ def delta( ... 2016-02-01T00:55:11,2016-02-01T01:24:34 ... 2016-02-01T00:11:13,2016-02-01T00:16:59''' >>> with open("/tmp/triptimes.csv", "w") as f: - ... _ = f.write(data) + ... nbytes = f.write(data) # nbytes is unused ... >>> taxi = ibis.read_csv("/tmp/triptimes.csv") >>> ride_duration = ( @@ -591,7 +591,7 @@ def delta( ... 2016-02-01T00:55:11,2016-02-01T01:24:34 ... 2016-02-01T00:11:13,2016-02-01T00:16:59''' >>> with open("/tmp/triptimes.csv", "w") as f: - ... _ = f.write(data) + ... nbytes = f.write(data) # nbytes is unused ... >>> taxi = ibis.read_csv("/tmp/triptimes.csv") >>> ride_duration = taxi.tpep_dropoff_datetime.delta(