Hi, when I ask cody to document code while cursor is inside a function it doesn’t add the python doc string triple quotes and messes up the formatting. It also uses very long line lengths.
def connect(self):
Connects to the SQL database using the provided connection string.
Returns:
pyodbc.Connection: The connection object to the SQL database.
Raises:
pyodbc.Error: If an error occurs while connecting to the database. The error message is logged and the program exits.
try:
conn = pyodbc.connect(self.connection_string)
except pyodbc.Error as e:
# sql_state = e.args[0]
error_message = e.args[1]
self.logger.exception(error_message)
sys.exit(1)
return conn