Skip to content

Commit

Permalink
Update write_database code blocks
Browse files Browse the repository at this point in the history
Changed the Python code examples for writing to a database in the user guide to match the py-polars polars.DataFrame.write_database API reference documentation. The current example of "uri=uri" returns an error when ran on the latest stable release of polars.
  • Loading branch information
JackRolfe committed Mar 17, 2024
1 parent 5e795c2 commit 496c15b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/python/user-guide/io/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
uri = "postgresql://username:password@server:port/database"
df = pl.DataFrame({"foo": [1, 2, 3]})
df.write_database(table_name="records", uri=uri)
df.write_database(table_name="records", connection=uri)
# --8<-- [end:write]
# --8<-- [start:write_adbc]
uri = "postgresql://username:password@server:port/database"
df = pl.DataFrame({"foo": [1, 2, 3]})
df.write_database(table_name="records", uri=uri, engine="adbc")
df.write_database(table_name="records", connection=uri, engine="adbc")
# --8<-- [end:write_adbc]
"""

0 comments on commit 496c15b

Please sign in to comment.