Skip to content

Fix typing violation in extract_fields()#888

Draft
ogenstad wants to merge 1 commit intoinfrahub-developfrom
pog-extract_fields-typing
Draft

Fix typing violation in extract_fields()#888
ogenstad wants to merge 1 commit intoinfrahub-developfrom
pog-extract_fields-typing

Conversation

@ogenstad
Copy link
Contributor

Why

Correct typing violations. - The inner loop iterates over node.selection_set.selections, which is typed as FrozenList[SelectionNode]. SelectionNode is a union of FieldNode | InlineFragmentNode | FragmentSpreadNode, but only FieldNode has a .name attribute — the other two don't. Without the guard, ty correctly flagged 4 unresolved-attribute errors on sub_node.name.value. The outer loop already had the correct isinstance(node, FieldNode) pattern; the inner loop was simply missing it.

What changed

Added if not isinstance(sub_node, FieldNode): continue at the top of the inner loop in extract_fields

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72312ccd-8264-4ff9-a196-c846776a81a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/utils.py 0.00% 1 Missing and 1 partial ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop     #888      +/-   ##
====================================================
- Coverage             80.98%   80.96%   -0.02%     
====================================================
  Files                   120      120              
  Lines                 10449    10451       +2     
  Branches               1562     1563       +1     
====================================================
  Hits                   8462     8462              
- Misses                 1475     1476       +1     
- Partials                512      513       +1     
Flag Coverage Δ
integration-tests 39.97% <0.00%> (-0.01%) ⬇️
python-3.10 52.52% <0.00%> (-0.02%) ⬇️
python-3.11 52.54% <0.00%> (+<0.01%) ⬆️
python-3.12 52.52% <0.00%> (-0.02%) ⬇️
python-3.13 52.52% <0.00%> (-0.03%) ⬇️
python-3.14 54.20% <0.00%> (-0.03%) ⬇️
python-filler-3.12 23.73% <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/utils.py 87.67% <0.00%> (-0.81%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant