Skip to content

feat: setup basic event structure - #3

Merged
bohan-amplitude merged 20 commits into
amplitude:mainfrom
bohan-amplitude:event
Mar 7, 2022
Merged

feat: setup basic event structure#3
bohan-amplitude merged 20 commits into
amplitude:mainfrom
bohan-amplitude:event

Conversation

@bohan-amplitude

Copy link
Copy Markdown
Contributor

Summary

  1. AbstractEvent Interface
  2. Event class implement AbstractEvent
  3. utils function to verify valid event

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: Yes

Comment thread src/amplitude/constants.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/plugin.py
Comment thread src/amplitude/client.py
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated

@justin-fiedler justin-fiedler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See comment about type hints.

Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/exception.py Outdated
Comment thread src/amplitude/client.py Outdated
Comment thread src/amplitude/client.py
def add(self, plugin):
pass
self.timeline.add(plugin)
return self

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

are we returning self so that we can chain method calls?

@bohan-amplitude bohan-amplitude Mar 3, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, for chaining calls.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@qingzhuozhen we're not allowing call chaining in js, specially for browser to support tree shaking, and I'd probably do the same for node for consistency. Should we address this parity?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I saw the kotlin version returned this too. The backend part probably should do the same.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is an interesting one. I believe for tree shaking support we could do something different in js. Some customers did ask about chaining support like in iOS (supported in android), wonder if we should allow un-parity on this.

Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py
Comment thread src/amplitude/utils.py Outdated
Comment thread src/amplitude/client.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py Outdated
Comment thread src/amplitude/event.py
Comment thread src/amplitude/client.py
def add(self, plugin):
pass
self.timeline.add(plugin)
return self

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is an interesting one. I believe for tree shaking support we could do something different in js. Some customers did ask about chaining support like in iOS (supported in android), wonder if we should allow un-parity on this.

@kevinpagtakhan

Copy link
Copy Markdown

lgtm

Comment thread src/amplitude/event.py Outdated
@bohan-amplitude
bohan-amplitude merged commit b624955 into amplitude:main Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants