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

refactor(types): move conversion to mixin, add helper functions 💥 #3750

Merged
merged 5 commits into from
Oct 22, 2021

Conversation

hanxiao
Copy link
Member

@hanxiao hanxiao commented Oct 22, 2021

Breaking changes:

  • .convert_image_datauri_to_blob() is removed and now you should use .convert_image_uri_to_blob() for both URI or dataURI.

New features:

  • can dump content directly to a file via .dump_buffer_to_file(), .dump_image_blob_to_file(), .dump_uri_to_file()
  • to resize (up/down-sampling) an image blob, use .resize_image_blob()

Misc:

  • Fix some bugs in conversion
  • Refactor the code for function-reusability and safe access on oneOf fields

@github-actions github-actions bot added size/M area/core This issue/PR affects the core codebase component/type labels Oct 22, 2021
@codecov
Copy link

codecov bot commented Oct 22, 2021

Codecov Report

Merging #3750 (cd960d0) into master (e1d650f) will increase coverage by 1.69%.
The diff coverage is 78.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3750      +/-   ##
==========================================
+ Coverage   87.89%   89.58%   +1.69%     
==========================================
  Files         156      156              
  Lines       11932    11911      -21     
==========================================
+ Hits        10488    10671     +183     
+ Misses       1444     1240     -204     
Flag Coverage Δ
daemon 44.92% <30.63%> (+0.66%) ⬆️
jina 88.49% <78.37%> (+1.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jina/helloworld/fashion/my_executors.py 93.15% <50.00%> (ø)
jina/types/document/converters.py 81.04% <76.76%> (-9.76%) ⬇️
jina/helloworld/multimodal/my_executors.py 97.69% <100.00%> (+7.98%) ⬆️
jina/types/document/__init__.py 96.73% <100.00%> (+0.47%) ⬆️
jina/peapods/pods/__init__.py 85.26% <0.00%> (-2.63%) ⬇️
jina/helper.py 82.76% <0.00%> (-0.36%) ⬇️
jina/peapods/runtimes/grpc/__init__.py 87.50% <0.00%> (+0.78%) ⬆️
jina/peapods/runtimes/jinad/__init__.py 85.08% <0.00%> (+0.87%) ⬆️
jina/peapods/zmq/__init__.py 89.06% <0.00%> (+0.93%) ⬆️
... and 19 more

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 e1d650f...cd960d0. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Oct 22, 2021

Latency summary

Current PR yields:

  • 🐢🐢 index QPS at 1184, delta to last 2 avg.: -20%
  • 🐢🐢 query QPS at 56, delta to last 2 avg.: -18%
  • 🐢🐢 dam extend QPS at 41807, delta to last 2 avg.: -26%
  • 🐢🐢 avg flow time within 1.0848 seconds, delta to last 2 avg.: -21%
  • 🐎🐎🐎🐎 import jina within 0.4559 seconds, delta to last 2 avg.: +17%

Breakdown

Version Index QPS Query QPS DAM Extend QPS Avg Flow Time (s) Import Time (s)
current 1184 56 41807 1.0848 0.4559
2.1.10 1701 79 65360 1.61 0.3175
2.1.9 1262 58 48265 1.1469 0.4596

Backed by latency-tracking. Further commits will update this comment.

@github-actions github-actions bot added size/L area/docs This issue/PR affects the docs area/testing This issue/PR affects testing labels Oct 22, 2021
@github-actions
Copy link

📝 Docs are deployed on https://refactor-doc-convert--jina-docs.netlify.app 🎉

@hanxiao hanxiao merged commit 40dbe5a into master Oct 22, 2021
@hanxiao hanxiao deleted the refactor-doc-convert branch October 22, 2021 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase area/docs This issue/PR affects the docs area/testing This issue/PR affects testing component/type size/L size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant