in dbt/adapters/maxcompute/connections.py [0:0]
def open(cls, connection):
if connection.state == "open":
logger.debug("Connection is already open, skipping open.")
return connection
credentials = connection.credentials
o = credentials.odps()
# always use UTC timezone
options.local_timezone = False
options.user_agent_pattern = "dbt-maxcompute $pyodps_version $python_version"
try:
o.get_project().reload()
except Exception as e:
raise DbtConfigError(f"Failed to connect to MaxCompute: {str(e)}") from e
handle = ConnectionWrapper(odps=o, hints=GLOBAL_SQL_HINTS)
connection.state = "open"
connection.handle = handle
return connection