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

Pull request for clean-msgpack #1202

Merged
merged 6 commits into from
Feb 18, 2020
Merged

Pull request for clean-msgpack #1202

merged 6 commits into from
Feb 18, 2020

Conversation

jd
Copy link
Contributor

@jd jd commented Feb 13, 2020

chord(encoding): remove unnused global variable

refactor(encoding): simplify msgpack/json encoders

This refactor the code to make it simpler:

  • we only define the useful class at load time based on msgpack availability
  • we declare methods are static when they are
  • we use class attributes rather than useless per-instance attribute

refactor(encoding): msgpack is a dependency, don't "try" to import it

We just import msgpack for sure since ddtrace depends on it, it has to be
there.

fix(setup): set minimum msgpack version we support

We test with 0.5.0 and above in the CI.

This refactor the code to make it simpler:
- we only define the useful class at load time based on msgpack availability
- we declare methods are static when they are
- we use class attributes rather than useless per-instance attribute
We just import msgpack for sure since ddtrace depends on it, it has to be
there.
@jd jd requested a review from a team as a code owner February 13, 2020 10:15
We test with 0.5.0 and above in the CI.
@jd
Copy link
Contributor Author

jd commented Feb 13, 2020

Note: this slightly breaks the API because I replaced ddtrace.encoding.Encoder but I don't think we support extending with your own encoder, so I don't think it makes sense to expose the base encoder class.

Copy link
Collaborator

@majorgreys majorgreys left a comment

Choose a reason for hiding this comment

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

It makes good sense now that we require msgpack and don't use it only when the c-extension is built.

@jd jd merged commit d1e26e7 into DataDog:master Feb 18, 2020
@jd jd deleted the clean-msgpack branch February 18, 2020 08:52
@majorgreys majorgreys added this to the 0.34.0 milestone Feb 19, 2020
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.

None yet

2 participants