Create an application using given :code:`gar` file, or given application class name. Args: graph (:class:`GraphDAGNode`): A :class:`GraphDAGNode` instance. app_assets: A :class:`AppAssets` instance.
(self, graph, app_assets: AppAssets)
| 332 | """ |
| 333 | |
| 334 | def __init__(self, graph, app_assets: AppAssets): |
| 335 | """Create an application using given :code:`gar` file, or given application |
| 336 | class name. |
| 337 | |
| 338 | Args: |
| 339 | graph (:class:`GraphDAGNode`): A :class:`GraphDAGNode` instance. |
| 340 | app_assets: A :class:`AppAssets` instance. |
| 341 | """ |
| 342 | self._graph = graph |
| 343 | |
| 344 | self._app_assets = app_assets |
| 345 | self._session = graph.session |
| 346 | self._app_assets.is_compatible(self._graph) |
| 347 | |
| 348 | self._op = bind_app(graph, self._app_assets) |
| 349 | # add app_assets op to dag is not exist |
| 350 | if not self._session.dag.exists(self._app_assets.op): |
| 351 | self._session.dag.add_op(self._app_assets.op) |
| 352 | # add op to dag |
| 353 | self._session.dag.add_op(self._op) |
| 354 | |
| 355 | # statically create the unload op to prevent a possible segmentation fault |
| 356 | # inside the protobuf library. |
| 357 | self._unload_op = unload_app(self) |
| 358 | |
| 359 | def __repr__(self): |
| 360 | s = f"graphscope.App <type: {self._app_assets.type}, algorithm: {self._app_assets.algo} " |
nothing calls this directly
no test coverage detected