(self, manifest: Manifest)
return valid, reparse_reason
Compare the global hashes of the read-in parse results' values to
        the known ones, and return if it is ok to re-use the results.
Compare the global hashes of the read-in parse results' values to
        the known ones, and return if it is ok to re-use the results.
Compare the global hashes of the read - in parse results values to the known ones and return if it is ok to re - use the results .
def is_partial_parsable(self, manifest: Manifest) -> Tuple[bool, Optional[str]]:
        """Compare the global hashes of the read-in parse results' values to
        the known ones, and return if it is ok to re-use the results.
        """
        valid = True
        reparse_reason = None

        if manifest.metadata.dbt_version != __version__:
            # #3757 log both versions because of reports of invalid cases of mismatch.
            fire_event(PartialParsingVersionMismatch(saved_version=manifest.metadata.dbt_version,
                                                     current_version=__version__))
            # If the version is wrong, the other checks might not work
            return False, ReparseReason.version_mismatch
        if self.manifest.state_check.vars_hash != manifest.state_check.vars_hash:
            fire_event(PartialParsingFailedBecauseConfigChange())
            valid = False
            reparse_reason = ReparseReason.vars_changed
        if self.manifest.state_check.profile_hash != manifest.state_check.profile_hash:
            # Note: This should be made more granular. We shouldn't need to invalidate
            # partial parsing if a non-used profile section has changed.
            fire_event(PartialParsingFailedBecauseProfileChange())
            valid = False
            reparse_reason = ReparseReason.profile_changed
        if self.manifest.state_check.project_env_vars_hash != \
                manifest.state_check.project_env_vars_hash:
            fire_event(PartialParsingProjectEnvVarsChanged())
            valid = False
            reparse_reason = ReparseReason.proj_env_vars_changed
        if self.manifest.state_check.profile_env_vars_hash != \
                manifest.state_check.profile_env_vars_hash:
            fire_event(PartialParsingProfileEnvVarsChanged())
            valid = False
            reparse_reason = ReparseReason.prof_env_vars_changed

        missing_keys = {
            k for k in self.manifest.state_check.project_hashes
            if k not in manifest.state_check.project_hashes
        }
        if missing_keys:
            fire_event(PartialParsingFailedBecauseNewProjectDependency())
            valid = False
            reparse_reason = ReparseReason.deps_changed

        for key, new_value in self.manifest.state_check.project_hashes.items():
            if key in manifest.state_check.project_hashes:
                old_value = manifest.state_check.project_hashes[key]
                if new_value != old_value:
                    fire_event(PartialParsingFailedBecauseHashChanged())
                    valid = False
                    reparse_reason = ReparseReason.project_config_changed
        return valid, reparse_reason
def is_partial_parsable ( self , manifest : Manifest ) -> Tuple [ bool , Optional [ str ] ] : valid = True reparse_reason = None if manifest . metadata . dbt_version != __version__ : # #3757 log both versions because of reports of invalid cases of mismatch. fire_event ( PartialParsingVersionMismatch ( saved_version = manifest . metadata . dbt_version , current_version = __version__ ) ) # If the version is wrong, the other checks might not work return False , ReparseReason . version_mismatch if self . manifest . state_check . vars_hash != manifest . state_check . vars_hash : fire_event ( PartialParsingFailedBecauseConfigChange ( ) ) valid = False reparse_reason = ReparseReason . vars_changed if self . manifest . state_check . profile_hash != manifest . state_check . profile_hash : # Note: This should be made more granular. We shouldn't need to invalidate # partial parsing if a non-used profile section has changed. fire_event ( PartialParsingFailedBecauseProfileChange ( ) ) valid = False reparse_reason = ReparseReason . profile_changed if self . manifest . state_check . project_env_vars_hash != manifest . state_check . project_env_vars_hash : fire_event ( PartialParsingProjectEnvVarsChanged ( ) ) valid = False reparse_reason = ReparseReason . proj_env_vars_changed if self . manifest . state_check . profile_env_vars_hash != manifest . state_check . profile_env_vars_hash : fire_event ( PartialParsingProfileEnvVarsChanged ( ) ) valid = False reparse_reason = ReparseReason . prof_env_vars_changed missing_keys = { k for k in self . manifest . state_check . project_hashes if k not in manifest . state_check . project_hashes } if missing_keys : fire_event ( PartialParsingFailedBecauseNewProjectDependency ( ) ) valid = False reparse_reason = ReparseReason . deps_changed for key , new_value in self . manifest . state_check . project_hashes . items ( ) : if key in manifest . state_check . project_hashes : old_value = manifest . state_check . project_hashes [ key ] if new_value != old_value : fire_event ( PartialParsingFailedBecauseHashChanged ( ) ) valid = False reparse_reason = ReparseReason . project_config_changed return valid , reparse_reason