[docs]classExtensionContext(object):# pylint: disable=E1101"""Context variables that extensions can access. It's also the base class of all extensions. """@propertydefparams(self)->ParamDict:"""Parameters set for using this extension. .. admonition:: Examples >>> FugueWorkflow().df(...).transform(using=dummy, params={"a": 1}) You will get ``{"a": 1}`` as `params` in the ``dummy`` transformer """returnself._params# type: ignore@propertydefworkflow_conf(self)->ParamDict:"""Workflow level configs, this is accessible even in :class:`~fugue.extensions.transformer.transformer.Transformer` and :class:`~fugue.extensions.transformer.transformer.CoTransformer` .. admonition:: Examples >>> dag = FugueWorkflow().df(...).transform(using=dummy) >>> dag.run(NativeExecutionEngine(conf={"b": 10})) You will get ``{"b": 10}`` as `workflow_conf` in the ``dummy`` transformer on both driver and workers. """if"_workflow_conf"inself.__dict__:returnself._workflow_conf# type: ignorereturnself.execution_engine.conf@propertydefexecution_engine(self)->ExecutionEngine:"""Execution engine for the current execution, this is only available on driver side """returnself._execution_engine# type: ignore@propertydefoutput_schema(self)->Schema:"""Output schema of the operation. This is accessible for all extensions ( if defined), and on both driver and workers """returnself._output_schema# type: ignore@propertydefkey_schema(self)->Schema:"""Partition keys schema, this is for transformers only, and available on both driver and workers """returnself._key_schema# type: ignore@propertydefpartition_spec(self)->PartitionSpec:"""Partition specification, this is for all extensions except for creators, and available on both driver and workers """returnself._partition_spec# type: ignore@propertydefcursor(self)->PartitionCursor:"""Cursor of the current logical partition, this is for transformers only, and only available on worker side """returnself._cursor# type: ignore@propertydefhas_callback(self)->bool:"""Whether this transformer has callback"""return("_has_rpc_client"inself.__dict__andself._has_rpc_client# type: ignore)@propertydefcallback(self)->RPCClient:"""RPC client to talk to driver, this is for transformers only, and available on both driver and workers """returnself._rpc_client# type: ignore@propertydefrpc_server(self)->RPCServer:"""RPC client to talk to driver, this is for transformers only, and available on both driver and workers """returnself._rpc_server# type: ignore@propertydefvalidation_rules(self)->Dict[str,Any]:"""Extension input validation rules defined by user"""return{}