verticapy.connection.global_connection.GlobalConnection.set_connection#
- GlobalConnection.set_connection(conn: Connection, section: str | None = None, dsn: str | None = None) None #
Returns the current dsn section.
Examples#
The following code demonstrates the usage of the function.
# Import the Global Connection. from verticapy.connection.global_connection import get_global_connection # Import the Vertica connection function from verticapy.connection import vertica_connection # Building a connection conn = vertica_connection("VerticaDSN") # Example get_global_connection().set_connection(conn)
Note
These functions serve as utilities to construct others, simplifying the overall code.