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

ref(analytics): Analytics Refactor + Types #30555

Merged
merged 10 commits into from
Jan 13, 2022
Merged

ref(analytics): Analytics Refactor + Types #30555

merged 10 commits into from
Jan 13, 2022

Conversation

mgaeta
Copy link
Contributor

@mgaeta mgaeta commented Dec 9, 2021

This PR refreshes the analytics modules with a few things:

  • splitting up large files
  • dataclasses
  • python types
    If there's too much going on here I think I can pull types into a separate PR.

@github-actions
Copy link
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Copy link
Member

@evanh evanh left a comment

Choose a reason for hiding this comment

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

Just a couple small things. I'll leave approval to someone who understands better the semantic changes here.

@@ -1,3 +1,4 @@
from sentry.utils.imports import import_submodules

import_submodules(globals(), __name__, __path__)
path = __path__ # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

Why did you need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without the ignore, mypy says:

error: Name '__path__' is not defined

Copy link
Member

Choose a reason for hiding this comment

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

Got it.


if isinstance(value, dict):
# Ensure we don't mutate the original. We do not need to deepcopy;
# if it recurses into another Map it will once again copy itself.
Copy link
Member

Choose a reason for hiding this comment

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

You're aware that if the dictionary has a list or some other complex object in it, that object will not be copied? The comment is a little unclear here, I can't tell if you're saying copy will recurse (which it won't) or extract recurses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just copied this class to a file so I don't know what the intention was for this comment. I'll leave a note in the code here.

Copy link
Member

@leeandher leeandher left a comment

Choose a reason for hiding this comment

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

Lots of questions (just for my understanding) before I approve, looks good though!

src/sentry/analytics/attribute.py Show resolved Hide resolved
src/sentry/analytics/base.py Show resolved Hide resolved
src/sentry/analytics/event.py Show resolved Hide resolved
src/sentry/analytics/event_manager.py Show resolved Hide resolved
Copy link
Member

@leeandher leeandher left a comment

Choose a reason for hiding this comment

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

Thanks for helping me understand the changes, looks good to me 👍

src/sentry/analytics/attribute.py Show resolved Hide resolved
src/sentry/analytics/base.py Show resolved Hide resolved
src/sentry/analytics/event.py Show resolved Hide resolved
src/sentry/analytics/event_manager.py Show resolved Hide resolved
@leeandher leeandher assigned mgaeta and unassigned leeandher Jan 13, 2022
@mgaeta mgaeta merged commit 2b4227c into master Jan 13, 2022
@mgaeta mgaeta deleted the ref/events-types branch January 13, 2022 22:48
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants