Skip to content

Commit

Permalink
docs: remove underscores that are not deferreds in doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and gforsyth committed Oct 2, 2023
1 parent 79788c7 commit 5d300a9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ibis/backends/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
"""
Expand Down
18 changes: 12 additions & 6 deletions ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
[]
Expand Down
4 changes: 2 additions & 2 deletions ibis/expr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ibis/expr/types/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 5d300a9

Please sign in to comment.