def needs_config(_): from dagster.core.executor.in_process import InProcessExecutor return InProcessExecutor( retries=RetryMode.from_config({"enabled": {}}), marker_to_close=None, )
def in_process_executor(init_context): '''The default in-process executor. In most Dagster environments, this will be the default executor. It is available by default on any :py:class:`ModeDefinition` that does not provide custom executors. To select it explicitly, include the following top-level fragment in config: .. code-block:: yaml execution: in_process: Execution priority can be configured using the ``dagster/priority`` tag via solid metadata, where the higher the number the higher the priority. 0 is the default and both positive and negative numbers can be used. ''' from dagster.core.executor.init import InitExecutorContext from dagster.core.executor.in_process import InProcessExecutor check.inst_param(init_context, 'init_context', InitExecutorContext) return InProcessExecutor( # shouldn't need to .get() here - issue with defaults in config setup retries=Retries.from_config( init_context.executor_config.get('retries', {'enabled': {}})), marker_to_close=init_context.executor_config.get('marker_to_close'), )
def _core_in_process_executor_creation(retries_config, marker_to_close): from dagster.core.executor.in_process import InProcessExecutor return InProcessExecutor( # shouldn't need to .get() here - issue with defaults in config setup retries=RetryMode.from_config(retries_config), marker_to_close=marker_to_close, )
def _core_in_process_executor_creation(config: Dict[str, Any]): from dagster.core.executor.in_process import InProcessExecutor return InProcessExecutor( # shouldn't need to .get() here - issue with defaults in config setup retries=RetryMode.from_config(config["retries"]), marker_to_close=config.get("marker_to_close"), )
def test_executor(init_context): from dagster.core.executor.in_process import InProcessExecutor assert init_context.executor_config == "secret testing value!!" return InProcessExecutor( # shouldn't need to .get() here - issue with defaults in config setup retries=RetryMode.from_config({"enabled": {}}), marker_to_close=None, )
def execute_in_process_executor(_): """Executor used by execute_in_process. Use of this executor triggers special behavior in the config system that ignores all incoming executor config. This is because someone might set executor config on a job, and when we foist this executor onto the job for `execute_in_process`, that config becomes nonsensical. """ from dagster.core.executor.in_process import InProcessExecutor return InProcessExecutor( retries=RetryMode.ENABLED, marker_to_close=None, )