Skip to content

Conversation

@ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Jan 22, 2026

Minor linting cleanup.

Summary by CodeRabbit

  • New Features

    • Exposed calculate_dict_height utility function for public use.
  • Bug Fixes

    • Improved data processing logic for consistent dictionary key-value access patterns.
  • Tests

    • Added unit tests for dictionary height calculation covering nested and mixed structures.
  • Chores

    • Updated linting configuration to enforce better coding standards.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

This pull request refactors dictionary iteration patterns across multiple files. In infrahub_sdk/operation.py, the process_nodes function is modified to iterate over data.items() and access edge data through the per-kind variable. In infrahub_sdk/utils.py, the deep merge utility is updated to use .items() for iteration, and calculate_dict_height is refactored to iterate over data.values(). The linter rule PLC0206 is removed from pyproject.toml to enforce these patterns. A new public function calculate_dict_height is added to the utils module with corresponding unit tests.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing dictionary value extraction patterns to use .items() where appropriate, which is confirmed by the pyproject.toml removal of PLC0206 linter rule and corresponding fixes in operation.py and utils.py.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 03e48c4
Status: ✅  Deploy successful!
Preview URL: https://ff341e93.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-plc0206.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##           stable     #764      +/-   ##
==========================================
- Coverage   80.39%   80.39%   -0.01%     
==========================================
  Files         115      115              
  Lines        9879     9878       -1     
  Branches     1513     1513              
==========================================
- Hits         7942     7941       -1     
  Misses       1415     1415              
  Partials      522      522              
Flag Coverage Δ
integration-tests 41.41% <28.57%> (+<0.01%) ⬆️
python-3.10 51.45% <71.42%> (-0.01%) ⬇️
python-3.11 51.45% <71.42%> (-0.01%) ⬇️
python-3.12 51.43% <71.42%> (-0.03%) ⬇️
python-3.13 51.43% <71.42%> (-0.01%) ⬇️
python-3.14 53.08% <71.42%> (-0.03%) ⬇️
python-filler-3.12 24.02% <0.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/operation.py 88.63% <100.00%> (ø)
infrahub_sdk/utils.py 88.53% <100.00%> (-0.06%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ogenstad ogenstad marked this pull request as ready for review January 23, 2026 12:59
@ogenstad ogenstad requested a review from a team January 26, 2026 13:41
@ogenstad ogenstad merged commit 2f0b00e into stable Jan 26, 2026
21 checks passed
@ogenstad ogenstad deleted the pog-plc0206 branch January 26, 2026 14:55
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