FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: skip doc attributes in __annotations__ but not in __fields__ by JoanFM · Pull Request #1777 · docarray/docarray · GitHub

fix: skip doc attributes in __annotations__ but not in __fields__ - #1777

Merged
JoanFM merged 1 commit into
mainfrom
fix-skip-annotations-not-in-field
Sep 7, 2023
Merged

fix: skip doc attributes in __annotations__ but not in __fields__#1777
JoanFM merged 1 commit into
mainfrom
fix-skip-annotations-not-in-field

Conversation

JoanFM commented Sep 6, 2023

Copy link
Copy Markdown
Member

Porting fix jina-ai/serve#6035 to docarray

Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
JoanFM force-pushed the fix-skip-annotations-not-in-field branch from e813ede to eea8c76 Compare September 6, 2023 15:33

NarekA commented Sep 6, 2023

Copy link
Copy Markdown

Thanks for doing this!

for field_name, field in model.__annotations__.items():
if field_name not in model.__fields__:
continue
field_info = model.__fields__[field_name].field_info

NarekA Sep 6, 2023
edited
Loading

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

FWIW: It might be a good idea to use something like pydash.get here in case traversal breaks at a different location.

codecov Bot commented Sep 6, 2023
edited
Loading

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (189ff63) 84.99% compared to head (eea8c76) 85.01%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1777      +/-   ##
==========================================
+ Coverage   84.99%   85.01%   +0.01%     
==========================================
  Files         134      134              
  Lines        8845     8847       +2     
==========================================
+ Hits         7518     7521       +3     
+ Misses       1327     1326       -1     
Flag Coverage Δ
docarray 85.01% <100.00%> (+0.01%) ⬆️

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

Files Changed Coverage Δ
docarray/utils/create_dynamic_doc_class.py 84.00% <100.00%> (+0.32%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

JoanFM commented Sep 6, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

Actually, @NarekA it would be nice if you could open this PR on your own so that we can properly credit the actual contributor. I just did not want to annoy you with it, but since you have already seen this and you are now aware of this need, it may be good to have this.

Could you open such a PR?

NarekA commented Sep 6, 2023

Copy link
Copy Markdown

Opening a new PR now

NarekA commented Sep 6, 2023

Copy link
Copy Markdown

Here: #1779

JoanFM closed this Sep 6, 2023
JoanFM reopened this Sep 6, 2023

github-actions Bot commented Sep 6, 2023

Copy link
Copy Markdown

📝 Docs are deployed on https://ft-fix-skip-annotations-not-in-field--jina-docs.netlify.app 🎉

JoanFM merged commit fb17456 into main Sep 7, 2023
JoanFM deleted the fix-skip-annotations-not-in-field branch September 7, 2023 07:07
JoanFM mentioned this pull request Sep 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL