-
Notifications
You must be signed in to change notification settings - Fork 6
Add docs for metadata and ordering #735
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||||||
| from infrahub_sdk import InfrahubClientSync | ||||||||||||||||
| from infrahub_sdk.types import NodeMetaOrder, Order | ||||||||||||||||
| from infrahub_sdk.enums import OrderDirection | ||||||||||||||||
|
|
||||||||||||||||
|
||||||||||||||||
| from infrahub_sdk import InfrahubClientSync | |
| from infrahub_sdk.types import NodeMetaOrder, Order | |
| from infrahub_sdk.enums import OrderDirection | |
| from infrahub_sdk import InfrahubClientSync | |
| from infrahub_sdk.enums import OrderDirection | |
| from infrahub_sdk.types import NodeMetaOrder, Order | |
🧰 Tools
🪛 GitHub Actions: CI
[error] 1-4: Ruff: Import block is unsorted. Organize imports.
🤖 Prompt for AI Agents
In @test.py around lines 1 - 4, Reorder the imports to satisfy the linter by
grouping and alphabetizing module paths and names: keep the top-level import
"InfrahubClientSync" first, then import from "infrahub_sdk.enums"
(OrderDirection), and finally from "infrahub_sdk.types" with the names sorted
(NodeMetaOrder, Order); update the three import lines accordingly.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code and add trailing newline.
Two issues:
- Line 10 contains commented-out debug code that should be removed.
- Line 12 is missing a trailing newline (flagged by pipeline).
🧹 Proposed fix
for tag in tags:
- # print(f"Tag: {tag.name.value}")
metadata = tag.get_node_metadata()
print(f"{tag.name.value} - Last updated: {metadata.updated_at}")
+🧰 Tools
🪛 GitHub Actions: CI
[error] 12-12: Ruff: No newline at end of file. Add trailing newline.
🤖 Prompt for AI Agents
In @test.py around lines 10 - 12, Remove the leftover commented debug line that
prints tag.name.value (the commented "print(f\"Tag: {tag.name.value}\")") so
only active code remains; ensure the remaining lines use tag.get_node_metadata()
and the print(f"{tag.name.value} - Last updated: {metadata.updated_at}") call,
and add a final trailing newline at the end of the file so the print line ends
with a newline character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a
get_relationship_metadata()method on RelatedNode objects to access the metadata of relationships.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ogenstad I have pushed a new commit which should resolve this.