Conversation
WalkthroughThis PR rewrites the Python SDK introduction MDX: front-matter title changed to "Python SDK overview"; MDX imports updated to use Docusaurus 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ 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. Comment |
Deploying infrahub-sdk-python with
|
| Latest commit: |
9cb30a5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d8b17757.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://bgi-overview-page.infrahub-sdk-python.pages.dev |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/docs/python-sdk/introduction.mdx (1)
46-47: Consider renaming the loop variable to avoid shadowing.In both examples, the
tagvariable created earlier is shadowed by thefor tag in tagsloop variable. While valid Python, this could confuse readers who may think they're still working with the originally created tag.📝 Suggested change for async example (line 46)
# Query all tags tags = await client.all(kind="BuiltinTag") - for tag in tags: - print(f"{tag.name.value} — {tag.description.value}") + for t in tags: + print(f"{t.name.value} — {t.description.value}")📝 Suggested change for sync example (line 72)
# Query all tags tags = client.all(kind="BuiltinTag") -for tag in tags: - print(f"{tag.name.value} — {tag.description.value}") +for t in tags: + print(f"{t.name.value} — {t.description.value}")Also applies to: 72-73
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/docs/python-sdk/introduction.mdx` around lines 46 - 47, The loop variable shadows the previously created variable named `tag`; rename the loop variable in both examples (the `for tag in tags` loops) to something non-conflicting (e.g., `t`, `listed_tag`, or `tag_item`) so readers don't confuse it with the earlier `tag` object; update both the async example at the first occurrence and the sync example (lines referenced) to use the new loop variable wherever `tag.name.value` and `tag.description.value` are accessed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/docs/python-sdk/introduction.mdx`:
- Around line 46-47: The loop variable shadows the previously created variable
named `tag`; rename the loop variable in both examples (the `for tag in tags`
loops) to something non-conflicting (e.g., `t`, `listed_tag`, or `tag_item`) so
readers don't confuse it with the earlier `tag` object; update both the async
example at the first occurrence and the sync example (lines referenced) to use
the new loop variable wherever `tag.name.value` and `tag.description.value` are
accessed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d4cebc49-23d9-4442-8390-7f0dc216b369
📒 Files selected for processing (1)
docs/docs/python-sdk/introduction.mdx
yjouffrault
left a comment
There was a problem hiding this comment.
everything looks good just need this small tweak
| - **Integrate with external systems** — Query and sync data between Infrahub and existing tools. `infrahubctl` and the Infrahub Ansible collection both use this SDK internally. | ||
| - **Build custom applications** — Use Infrahub as a data backend for Python projects entirely outside of Infrahub's own pipeline. | ||
|
|
||
| **Why the SDK over direct API calls:** eliminates the need to learn Infrahub's API structure, provides Python-native interfaces with built-in auth, adds advanced capabilities (batching, caching, tracking), and reduces boilerplate. |
There was a problem hiding this comment.
| **Why the SDK over direct API calls:** eliminates the need to learn Infrahub's API structure, provides Python-native interfaces with built-in auth, adds advanced capabilities (batching, caching, tracking), and reduces boilerplate. | |
| **When to use the SDK instead of direct API calls:** eliminates the need to learn Infrahub's API structure, provides Python-native interfaces with built-in auth, adds advanced capabilities (batching, caching, tracking), and reduces boilerplate. |
Summary by CodeRabbit