Skip to content

Adding new to_dict method for Document #171

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

Merged
merged 4 commits into from
Mar 2, 2023

Conversation

vrdmr
Copy link
Member

@vrdmr vrdmr commented Feb 25, 2023

Fixes #170

@codecov
Copy link

codecov bot commented Feb 25, 2023

Codecov Report

Merging #171 (d837985) into dev (4e32a20) will decrease coverage by 0.06%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##              dev     #171      +/-   ##
==========================================
- Coverage   90.36%   90.31%   -0.06%     
==========================================
  Files          53       53              
  Lines        3031     3036       +5     
  Branches      802      803       +1     
==========================================
+ Hits         2739     2742       +3     
- Misses        215      217       +2     
  Partials       77       77              
Flag Coverage Δ
unittests 90.28% <60.00%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
azure/functions/_cosmosdb.py 85.00% <50.00%> (-3.89%) ⬇️
azure/functions/_abc.py 75.72% <66.66%> (-0.10%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

def to_dict(self) -> dict:
"""Return the document as a dict - directly using self would also work
as Document is ``UserDict`` subclass and behave like dict"""
return dict(self)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add a test for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't have direct way of testing to_json, to_dict and other library methods. This is actually raising that we should have unittests for them as well.

@gavin-aguiar gavin-aguiar merged commit 847f763 into dev Mar 2, 2023
@gavin-aguiar gavin-aguiar deleted the vameru/cosmosdb-document-to-dict branch March 2, 2023 23:10
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.

[FeatureRequest] add to_dict to func.Document for CosmosDB
3 participants