https://github.com/apache/airflow/blob/6c458f29c0eeadb1282e524e76fdd379d6436824/airflow/providers/apache/hive/hooks/hive.py#L464

It should be:
```
if hasattr(self, 'sub_process')
```
airflow/providers/apache/hive/hooks/hive.py
state = dict(self.__dict__)
        del state['metastore']
        return state
    def __setstate__(self, d: Dict[str, Any]) -> None:
        self.__dict__.update(d)
        self.__dict__['metastore'] = self.get_metastore_client()
    def get_metastore_client(self) -> Any:
        """Returns a Hive thrift client."""
        import hmsclient
        from thrift.protocol import TBinaryProtocol
        from thrift.transport import TSocket, TTransport
        conn = self._find_valid_server()
        if not conn:
            raise AirflowException("Failed to locate the valid server.")
        auth_mechanism = conn.extra_dejson.get('authMechanism', 'NOSASL')
        if conf.get('core', 'security') == 'kerberos':
            auth_mechanism = conn.extra_dejson.get('authMechanism', 'GSSAPI')
            kerberos_service_name = conn.extra_dejson.get('kerberos_service_name', 'hive')
        conn_socket = TSocket.TSocket(conn.host, conn.port)
        if conf.get('core', 'security') == 'kerberos' and auth_mechanism == 'GSSAPI':
            try:
                import saslwrapper as sasl
            except ImportError:
                import sasl
            def sasl_factory() -> sasl.Client: