Skip to content

Conversation

@dgarros
Copy link
Contributor

@dgarros dgarros commented Jan 5, 2025

This PR fixes an issue introduced by #199 that would prevent a node with relationship of cardinality one from being updated.

As a workaround, it's recommended to enable the property when querying the object (property=True)

This is good reminder that :

  1. We need more integration tests
  2. We need to refactor how the SDK manages partial update today (_strip_unmodified)

I've also included the RN and the version upgrade to 1.4.1 in this PR

@codecov
Copy link

codecov bot commented Jan 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@@            Coverage Diff             @@
##           stable     #212      +/-   ##
==========================================
+ Coverage   67.79%   68.03%   +0.23%     
==========================================
  Files          82       82              
  Lines        7360     7370      +10     
  Branches     1438     1440       +2     
==========================================
+ Hits         4990     5014      +24     
+ Misses       1993     1984       -9     
+ Partials      377      372       -5     
Flag Coverage Δ
integration-tests 13.01% <100.00%> (+0.47%) ⬆️
python-3.10 43.27% <9.09%> (+0.14%) ⬆️
python-3.11 43.27% <9.09%> (+0.14%) ⬆️
python-3.12 43.27% <9.09%> (+0.14%) ⬆️
python-3.13 43.27% <9.09%> (+0.14%) ⬆️
python-3.9 41.70% <9.09%> (+0.14%) ⬆️
python-filler-3.12 24.07% <0.00%> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
infrahub_sdk/node.py 77.73% <100.00%> (+1.24%) ⬆️
infrahub_sdk/testing/schemas/car_person.py 81.41% <100.00%> (+2.77%) ⬆️

@dgarros dgarros force-pushed the dga-20250105-fix-update branch 4 times, most recently from 0c1770d to eda56dc Compare January 5, 2025 18:14
@dgarros dgarros marked this pull request as ready for review January 5, 2025 18:29
@dgarros dgarros force-pushed the dga-20250105-fix-update branch from eda56dc to b454b92 Compare January 5, 2025 18:31
@dgarros dgarros requested a review from a team January 5, 2025 18:33
Copy link
Contributor

@ajtmccarty ajtmccarty left a comment

Choose a reason for hiding this comment

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

2 "you can do it if you want to" comments and one commented-out line that can maybe be removed

# assert sorted([tag.peer_id for tag in tags]) == sorted([tag_green.id, tag_blue.id])
car3 = await client.get(kind=TESTING_CAR, id=car_golf.id)
await car3.tags.fetch()
assert sorted([tag.id for tag in car3.tags.peers]) == sorted([tag_green.id, tag_blue.id])
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use sets for these instead of sorting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, not sure how i missed that, I'll fix in another PR

@dgarros dgarros force-pushed the dga-20250105-fix-update branch from 0b9c723 to 2423449 Compare January 5, 2025 18:54
@dgarros dgarros force-pushed the dga-20250105-fix-update branch from 2423449 to 64b5dff Compare January 5, 2025 18:57
@dgarros dgarros merged commit 74e3a69 into stable Jan 5, 2025
14 checks passed
@dgarros dgarros deleted the dga-20250105-fix-update branch January 5, 2025 19:02
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.

3 participants