Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/191.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Disable by default the inclusion of properties for Attribute and Relationships when querying nodes from Infrahub.
The inclusion of properties can be enabled by using the parameter property in client.get|all|filters
32 changes: 32 additions & 0 deletions infrahub_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ async def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> SchemaType | None: ...

Expand All @@ -349,6 +350,7 @@ async def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> SchemaType: ...

Expand All @@ -367,6 +369,7 @@ async def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> SchemaType: ...

Expand All @@ -385,6 +388,7 @@ async def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> InfrahubNode | None: ...

Expand All @@ -403,6 +407,7 @@ async def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> InfrahubNode: ...

Expand All @@ -421,6 +426,7 @@ async def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> InfrahubNode: ...

Expand All @@ -438,6 +444,7 @@ async def get(
populate_store: bool = False,
fragment: bool = False,
prefetch_relationships: bool = False,
property: bool = False,
**kwargs: Any,
) -> InfrahubNode | SchemaType | None:
branch = branch or self.default_branch
Expand Down Expand Up @@ -470,6 +477,7 @@ async def get(
exclude=exclude,
fragment=fragment,
prefetch_relationships=prefetch_relationships,
property=property,
**filters,
)

Expand Down Expand Up @@ -533,6 +541,7 @@ async def all(
exclude: list[str] | None = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
) -> list[SchemaType]: ...

@overload
Expand All @@ -549,6 +558,7 @@ async def all(
exclude: list[str] | None = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
) -> list[InfrahubNode]: ...

async def all(
Expand All @@ -564,6 +574,7 @@ async def all(
exclude: list[str] | None = None,
fragment: bool = False,
prefetch_relationships: bool = False,
property: bool = False,
) -> list[InfrahubNode] | list[SchemaType]:
"""Retrieve all nodes of a given kind

Expand Down Expand Up @@ -595,6 +606,7 @@ async def all(
exclude=exclude,
fragment=fragment,
prefetch_relationships=prefetch_relationships,
property=property,
)

@overload
Expand All @@ -612,6 +624,7 @@ async def filters(
fragment: bool = ...,
prefetch_relationships: bool = ...,
partial_match: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> list[SchemaType]: ...

Expand All @@ -630,6 +643,7 @@ async def filters(
fragment: bool = ...,
prefetch_relationships: bool = ...,
partial_match: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> list[InfrahubNode]: ...

Expand All @@ -647,6 +661,7 @@ async def filters(
fragment: bool = False,
prefetch_relationships: bool = False,
partial_match: bool = False,
property: bool = False,
**kwargs: Any,
) -> list[InfrahubNode] | list[SchemaType]:
"""Retrieve nodes of a given kind based on provided filters.
Expand Down Expand Up @@ -696,6 +711,7 @@ async def filters(
fragment=fragment,
prefetch_relationships=prefetch_relationships,
partial_match=partial_match,
# property=property,
)
query = Query(query=query_data)
response = await self.execute_graphql(
Expand Down Expand Up @@ -1549,6 +1565,7 @@ def all(
exclude: list[str] | None = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
) -> list[SchemaTypeSync]: ...

@overload
Expand All @@ -1565,6 +1582,7 @@ def all(
exclude: list[str] | None = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
) -> list[InfrahubNodeSync]: ...

def all(
Expand All @@ -1580,6 +1598,7 @@ def all(
exclude: list[str] | None = None,
fragment: bool = False,
prefetch_relationships: bool = False,
property: bool = False,
) -> list[InfrahubNodeSync] | list[SchemaTypeSync]:
"""Retrieve all nodes of a given kind

Expand Down Expand Up @@ -1611,6 +1630,7 @@ def all(
exclude=exclude,
fragment=fragment,
prefetch_relationships=prefetch_relationships,
property=property,
)

def _process_nodes_and_relationships(
Expand Down Expand Up @@ -1663,6 +1683,7 @@ def filters(
fragment: bool = ...,
prefetch_relationships: bool = ...,
partial_match: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> list[SchemaTypeSync]: ...

Expand All @@ -1681,6 +1702,7 @@ def filters(
fragment: bool = ...,
prefetch_relationships: bool = ...,
partial_match: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> list[InfrahubNodeSync]: ...

Expand All @@ -1698,6 +1720,7 @@ def filters(
fragment: bool = False,
prefetch_relationships: bool = False,
partial_match: bool = False,
property: bool = False,
**kwargs: Any,
) -> list[InfrahubNodeSync] | list[SchemaTypeSync]:
"""Retrieve nodes of a given kind based on provided filters.
Expand Down Expand Up @@ -1747,6 +1770,7 @@ def filters(
fragment=fragment,
prefetch_relationships=prefetch_relationships,
partial_match=partial_match,
property=property,
)
query = Query(query=query_data)
response = self.execute_graphql(
Expand Down Expand Up @@ -1799,6 +1823,7 @@ def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> SchemaTypeSync | None: ...

Expand All @@ -1817,6 +1842,7 @@ def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> SchemaTypeSync: ...

Expand All @@ -1835,6 +1861,7 @@ def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> SchemaTypeSync: ...

Expand All @@ -1853,6 +1880,7 @@ def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> InfrahubNodeSync | None: ...

Expand All @@ -1871,6 +1899,7 @@ def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> InfrahubNodeSync: ...

Expand All @@ -1889,6 +1918,7 @@ def get(
populate_store: bool = ...,
fragment: bool = ...,
prefetch_relationships: bool = ...,
property: bool = ...,
**kwargs: Any,
) -> InfrahubNodeSync: ...

Expand All @@ -1906,6 +1936,7 @@ def get(
populate_store: bool = False,
fragment: bool = False,
prefetch_relationships: bool = False,
property: bool = False,
**kwargs: Any,
) -> InfrahubNodeSync | SchemaTypeSync | None:
branch = branch or self.default_branch
Expand Down Expand Up @@ -1938,6 +1969,7 @@ def get(
exclude=exclude,
fragment=fragment,
prefetch_relationships=prefetch_relationships,
property=property,
**filters,
)

Expand Down
Loading
Loading