Skip to content

Commit

Permalink
adds documentation for property argument for SDK query methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wvandeun committed Jan 9, 2025
1 parent 7e6f318 commit 52413cc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/docs/python-sdk/guides/query_data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,31 @@ Values of type `str` will be parsed using the [Pendulum](https://pendulum.eustac
</TabItem>
</Tabs>

### Properties of attributes and relationships

By default, the [meta data or properties](/topics/metadata) of attributes and relationships are not included. We can include these properties using the `property` argument of the SDK client's `all`, `filters` or `get` method.

<Tabs groupId="async-sync">
<TabItem value="Async" default>

```python
device = await client.get(kind="TestDevice", name__value="atl1-edge1", property=True)
print(device.name.is_protected)
print(device.name.source.display_label)
```

</TabItem>
<TabItem value="Sync" default>

```python
device = client.get(kind="TestDevice", name__value="atl1-edge1", property=True)
print(device.name.protected)
print(device.name.source.display_label)
```

</TabItem>
</Tabs>

## Query a node(s) in a different branch

If you want to query a node(s) in a different branch than the default branch with which the SDK client was initiated, then you can use the `branch` argument of the query methods.
Expand Down

0 comments on commit 52413cc

Please sign in to comment.