@classmethod<EOL><INDENT>@provide_session<EOL>def get_one(cls,<EOL>execution_date,<EOL>key=None,<EOL>task_id=None,<EOL>dag_id=None,<EOL>include_prior_dates=False,<EOL>session=None):<DEDENT>
filters = []<EOL>if key:<EOL><INDENT>filters.append(cls.key == key)<EOL><DEDENT>if task_id:<EOL><INDENT>filters.append(cls.task_id == task_id)<EOL><DEDENT>if dag_id:<EOL><INDENT>filters.append(cls.dag_id == dag_id)<EOL><DEDENT>if include_prior_dates:<EOL><INDENT>filters.append(cls.execution_date <= execution_date)<EOL><DEDENT>else:<EOL><INDENT>filters.append(cls.execution_date == execution_date)<EOL><DEDENT>query = (<EOL>session.query(cls.value).filter(and_(*filters))<EOL>.order_by(cls.execution_date.desc(), cls.timestamp.desc()))<EOL>result = query.first()<EOL>if result:<EOL><INDENT>enable_pickling = configuration.getboolean('<STR_LIT>', '<STR_LIT>')<EOL>if enable_pickling:<EOL><INDENT>return pickle.loads(result.value)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>return json.loads(result.value.decode('<STR_LIT>'))<EOL><DEDENT>except ValueError:<EOL><INDENT>log = LoggingMixin().log<EOL>log.error("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>raise<EOL><DEDENT><DEDENT><DEDENT>
Retrieve an XCom value, optionally meeting certain criteria.
TODO: "pickling" has been deprecated and JSON is preferred.
"pickling" will be removed in Airflow 2.0.

:return: XCom value