MCPcopy Create free account
hub / github.com/dagger/dagger / session

Method session

sdk/python/src/dagger/client/_session.py:238–251  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

236
237 @property
238 def session(self) -> ClientSession:
239 if not self._session:
240 logger.debug("Configuring shared connection to GraphQL server")
241
242 # Delay checking the environment until we actually need it.
243 if not self._params:
244 self._params = ConnectParams.from_env()
245
246 if not self._params:
247 msg = "No active engine session to connect to"
248 raise ClientConnectionError(msg)
249
250 self._session = ClientSession(self._params, self._cfg)
251 return self._session
252
253 def is_connected(self) -> bool:
254 return self._session is not None and self._session.has_session()

Callers

nothing calls this directly

Calls 4

ClientSessionClass · 0.85
from_envMethod · 0.80
debugMethod · 0.45

Tested by

no test coverage detected