Skip to content

Commit

Permalink
docstring + remove None return type
Browse files Browse the repository at this point in the history
  • Loading branch information
spicy-sauce committed Aug 13, 2024
1 parent 25c10bb commit 1b83d28
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/src/datayoga_core/blocks/relational/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ def get_engine(connection_name: str, context: Context, autocommit: bool = True)
return engine, db_type


def alter_session_on_oracle_connect(dbapi_connection: DBAPIConnection, connection_record: ConnectionPoolEntry) -> None:
"""
SQLAlchemy event listener to alter the Oracle session settings upon connection.
def alter_session_on_oracle_connect(dbapi_connection: DBAPIConnection, connection_record: ConnectionPoolEntry):
"""SQLAlchemy event listener to alter the Oracle session settings upon connection.
This callback function is intended to be used with SQLAlchemy's `connect` event.
It alters the Oracle session settings by setting the `NLS_DATE_FORMAT` for the session
Expand All @@ -91,9 +90,6 @@ def alter_session_on_oracle_connect(dbapi_connection: DBAPIConnection, connectio
Args:
dbapi_connection (DBAPIConnection): The raw DB-API connection object provided by the Oracle driver.
connection_record (ConnectionPoolEntry): A record associated with the connection, managed by SQLAlchemy.
Returns:
None
"""
cursor = dbapi_connection.cursor()
cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'")
Expand Down

0 comments on commit 1b83d28

Please sign in to comment.