This note presents an investigation of the properties of the coupling between the Higgs boson and the top quark, employing 139 fb of proton--proton collision data recorded by the ATLAS experiment at a centre-of-mass energy of TeV. The structure of the top-Higgs boson Yukawa coupling is probed in events with a Higgs boson decaying to a pair of quarks and produced in association with a pair of top quarks, , or a single top quark, . Events containing one or two electrons or muons are used for the measurement. In an extension of the Standard Model with a CP-odd admixture to the top-Higgs Yukawa coupling, the mixing angle between -even and -odd couplings is measured to be \alpha=11^{\circ+55^{\circ}}_{~-77^{\circ}}. A pure -odd coupling is disfavoured by the data at 1.2 confidence level.