I’d say this whole passage is in fact A major as a dominant to D minor. The minor tonality includes both the raised 6th and the raised 7th, the raised 7th as leading tone which has to resolve to the tonic, and the raised 6th as preparation of the raised 7th which is supposed to be followed by the raised 7th.
So technically it is not a problem for this being D minor, although this raised 7th is something typical for the dominant. Now, the problem is that in this passage all strong notes fall on notes of the A major chord, which makes this not feel like a tonic in D minor, but a dominant in D minor.
I’d naturally expect this phrase to continue something like this:

On the other hand if we simply shift the phrase a bit so the d minor notes fall on strong beats it becomes very clear D minor:
