The first dependency grammar (DG) parse given in the question looks like this:
The second DG parse given in the question looks like this:
Neither of those two parses is linguistically well-motivated, although the second is somewhat better than the first. There is another parse that is much better than both of those. This other parse is next:
This parse sees auxiliary verbs dominating content verbs, and prepositions dominating their noun phrases. These assumptions about dependency structures are well-motivated linguistically. The matter is discussed at length in this recent article in Glossa.
The practice of positioning function words as dependents of content words, which is what you see in the first two parses to varying degrees, is something that arose at Stanford in the early 2000s. That trend continues today, most prominently in the form of the Universal Dependencies (UD) annotation scheme. However, a lengthy tradition in the DG community -- a tradition reaching back about four decades -- produces parses along the lines of the third tree, which views most function words as heads over the co-occurring content words. The history of this issue is discussed in these conference proceedings.
This issue currently splits the DG community. Theoretical DG people like myself argue vehemently in favor of the third parse above, which views most function words as heads over the co-occurring content words. Computational DG people are split into two camps concerning the matter. The one camp is represented by the annotation scheme of the UD project, which is already linked to above. The other camp of computational DG people is more in line with theoreticians insofar as they prefer parses along the lines of the third tree. See the Surface-Syntactic Universal Dependencies (SUD) webpage in this regard.
Turning to the example sentence from the question, it challenges theoretical analyses regardless of the annotation choices. The problem it poses is that it appears to lack a subject phrase, for there is no overt subject noun phrase present. What seems to be occurring in such cases, however, is that a nominal of some sort is elided. While the nature of the ellipsis mechanism involved is not immediately evident, one might posit the existence of an elided gerund, e.g.
The conditions that must be met for this type of ellipsis to occur require investigation. I cannot say anything more about the potential of such an account.
As a final comment, there are of course various annotation schemes out there that can be accessed. I think each linguist needs to be aware of what is at stake when choosing an annotation scheme and decide for him- or herself. If the annotation scheme should be linguistically solid, then parses along the lines of the third tree above are the best choice.