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

protocol: follow strict datatype in TJsonProtocol, fixes #71 #85

Merged
merged 4 commits into from
Sep 24, 2019
Merged

protocol: follow strict datatype in TJsonProtocol, fixes #71 #85

merged 4 commits into from
Sep 24, 2019

Conversation

iamsudip
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 20, 2019

Codecov Report

Merging #85 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
+ Coverage   80.79%   80.86%   +0.07%     
==========================================
  Files          35       35              
  Lines        3540     3527      -13     
==========================================
- Hits         2860     2852       -8     
+ Misses        680      675       -5
Impacted Files Coverage Δ
thriftpy2/protocol/json.py 82.14% <100%> (+2.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20ca02c...d3c1dc9. Read the comment docs.

thriftpy2/protocol/json.py Show resolved Hide resolved
thriftpy2/protocol/json.py Outdated Show resolved Hide resolved
thriftpy2/protocol/json.py Show resolved Hide resolved
thriftpy2/protocol/json.py Outdated Show resolved Hide resolved

if ttype == TType.MAP:
return map_to_json(val, spec)
TTYPE_TO_JSONFUNC_MAP = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ethe Do you think with there is negative performance impact if we move to map from branching?

Copy link
Member

Choose a reason for hiding this comment

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

I think there is not much impact here.

if ttype in (TType.STRING, TType.BOOL):
return val

TTYPE_TO_OBJFUNC_MAP = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here.

@iamsudip iamsudip requested a review from ethe September 23, 2019 21:26
Copy link
Member

@ethe ethe left a comment

Choose a reason for hiding this comment

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

LGTM

@ethe ethe merged commit 7eaa5ef into Thriftpy:master Sep 24, 2019
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.

2 participants