Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended export script #1954

Merged
merged 5 commits into from Mar 4, 2023
Merged

Extended export script #1954

merged 5 commits into from Mar 4, 2023

Conversation

yk
Copy link
Collaborator

@yk yk commented Mar 3, 2023

  • adds events (emojis, ratings, rankings) to export trees
  • add anonymizer to anonymize user and message IDs in a stable way

@yk yk added the backend label Mar 3, 2023
@yk yk requested a review from andreaskoepf as a code owner March 3, 2023 22:28

return qry.all()


def get_events_for_messages(db: Session, message_ids: list[UUID]) -> dict[UUID, ExportMessageEvent]:
events = {}
emojis = db.query(MessageEmoji).filter(MessageEmoji.message_id.in_(message_ids)).all()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(We have to test this with the the production db size, I had similar code before for labels which I re-wrote after the query took > 0.5h to execute for 100k messages .. i.e. fetch_tree_messages_and_avg_labels function does the join now directly ...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point. let's test and see

backend/export.py Outdated Show resolved Hide resolved
@yk yk merged commit 21dcc77 into main Mar 4, 2023
@yk yk deleted the extended-export-script branch March 4, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants