Closed andylolz closed 5 years ago
Yep, here's my example. Constructing a complex xpath query seems to be the only solution
dfid = iatikit.data().publishers.find(name='dfid')
dfid_wb = dfid.activities.where(xpath='participating-org/@ref="44000"')
dfid_wb.count() #1179
dfid_wb_h1 = dfid_wb.where(xpath='@hierarchy=1')
dfid_wb_h1.count() #5264
dfid_wb = dfid.activities.where(xpath='@hierarchy="1" and participating-org/@ref="44000"')
dfid_wb.count() #527
Thanks @johnadamsDFID! Exactly right – that’s the only workaround currently :(
This is very annoying and also very fixable, so it’s next up.
Yep, took me quite a while of head scratching to work out why the numbers were going up!
Ha! Right, yes. Sorry about that!
Fixed in b41f5d3. (This will be part of the next release.)
@johnadamsDFID with the fix in place, your example now gives the expected result:
dfid = iatikit.data().publishers.find(name='dfid')
dfid_wb = dfid.activities.where(xpath='participating-org/@ref="44000"')
dfid_wb.count() #1179
dfid_wb_h1 = dfid_wb.where(xpath='@hierarchy=1')
dfid_wb_h1.count() #527
It’s possible to chain together multiple
where
filters, like this:It *ought to be possible* to chain together multiple
where
filters that use the same keyword. So for instance, multiplexpath
queries.However, this *isn’t* currently possible, and the behaviour is WEIRD. This is a bug!