« first day (1205 days earlier)      last day (892 days later) » 

1:24 AM
I wanted to get some query which counts Enlightened badges also for deleted user (i.e., how many they would get if they still had an account).
For some users I get correct number, but for some users there are differences: data.stackexchange.com/mathoverflow/query/1175429/…
For example, the top user on MO has 265 Enlightened badges and the above query returns 252.
Can the difference be caused by the fact that some of the Englightened badges are for answers to deleted question? For deleted questions, the info about accepted answer isn't stored in SEDE, right?
Maybe checking this on some site where I have 10k+ would be a reasonable idea.
This answer is in the list: meta.stackexchange.com/questions/117084/… I see, probably the answers which were accepted and later unaccepted still might give user a badge.
Ok, so I have tried to use v.VoteTypeId=10 instead of q.AcceptedAnswer Id, but there is still a discrepancy: data.stackexchange.com/meta.stackexchange/query/1511200/…
For this particular user, I still get only 14 answers: data.stackexchange.com/meta.stackexchange/query/1511201/…
Here is list of their Enlightened badges listed on the site: meta.stackexchange.com/help/badges/19/enlightened?userid=159251
As mentioned above, this answer is shown in the list:
17
A: How to handle answer where poster wants credit for code if used?

jscsAll the content on Stack Overflow comes with a Creative Commons license which requires attribution (these links are found at the bottom of every page). Quoting from the relevant Stack Overflow blog post: If you republish this content, we require that you: Visually indicate that the content is f...

I thought that accept and unaccept might be shown in the timeline: meta.stackexchange.com/posts/117085/…
In any case, I have at least query which returns at least approximate results. Since I was driven mainly by curiosity, that is probably sufficient. (But still, I'm a bit curious whether the difference is cause by answers which were later unaccepted or by something else.)
Sorry for many message - looking back at what I wrote, this looks more like rubberducking than like asking a specific question in chat.
 
 
4 hours later…
6:23 AM
@Martin that is certainly true. And we don't have those unaccept events in SEDE either.
@Martin the Votes table should have the accept vote (votetypeid = 1 ) for deleted answers. Via PostsWithDeleted you can then find the question that answer was on.
 
6:56 AM
@rene Ok, so for deleted question I can still get VoteTypeId=1. But if I wanted in some query use AcceptedAnswerId, that will be NULL in the PostsWithDeleted table.
BTW I meant VoteTypeId=1 when I wrote VoteTypeId=10 in the above message.
This is weird - I have tried to replace Posts with PostsWithDeleted; in case there are some (probably rather rare) cases when Englightened badge was awarded for a question/answer pair which have been deleted since then.
And I have seen that I get lower numbers after looking at deleted posts, too.
Ok, now I realized that what I tried is completely non-sensical - for deleted posts I do not get UserOwnerId from SEDE.
But I would still expect to get those result which are found using Posts table also using PostsWithDeleted.
AnswerCount is another thing which I used in that query and which isn't available for deleted questions.
 
8:00 AM
Yeah, when you want to reason about deleted posts you always need extra mental hoops to jump through only to get partial, incomplete or open for interpretation results.
 

« first day (1205 days earlier)      last day (892 days later) »