sift_client.resources.calculated_channels
¶
| CLASS | DESCRIPTION |
|---|---|
CalculatedChannelsAPIAsync |
High-level API for interacting with calculated channels. |
CalculatedChannelsAPIAsync
¶
CalculatedChannelsAPIAsync(sift_client: SiftClient)
Bases: ResourceBase
High-level API for interacting with calculated channels.
This class provides a Pythonic, notebook-friendly interface for interacting with the CalculatedChannelsAPI. It handles automatic handling of gRPC services, seamless type conversion, and clear error handling.
All methods in this class use the CalculatedChannel class from the low-level wrapper, which is a user-friendly representation of a calculated channel using standard Python data structures and types.
Initialize the CalculatedChannelsAPI.
| PARAMETER | DESCRIPTION |
|---|---|
sift_client
|
The Sift client to use.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
archive |
Archive a calculated channel. |
create |
Create a calculated channel. |
find |
Find a single calculated channel matching the given query. Takes the same arguments as |
get |
Get a Calculated Channel. |
list_ |
List calculated channels with optional filtering. This will return the latest version. To find all versions, use |
list_versions |
List versions of a calculated channel. |
unarchive |
Unarchive a calculated channel. |
update |
Update a Calculated Channel. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
client |
TYPE:
|
grpc_client |
TYPE:
|
rest_client |
TYPE:
|
archive
async
¶
archive(
calculated_channel: str | CalculatedChannel,
) -> CalculatedChannel
Archive a calculated channel.
| PARAMETER | DESCRIPTION |
|---|---|
calculated_channel
|
The id or CalculatedChannel object of the calculated channel to archive.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CalculatedChannel
|
The archived CalculatedChannel. |
create
async
¶
create(
create: CalculatedChannelCreate | dict,
) -> CalculatedChannel
Create a calculated channel.
| PARAMETER | DESCRIPTION |
|---|---|
create
|
A CalculatedChannelCreate object or dictionary with configuration for the new calculated channel. This should include properties like name, expression, channel_references, etc.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CalculatedChannel
|
The created CalculatedChannel. |
find
async
¶
find(**kwargs) -> CalculatedChannel | None
Find a single calculated channel matching the given query. Takes the same arguments as list but handles checking for multiple matches.
Will raise an error if multiple calculated channels are found.
| PARAMETER | DESCRIPTION |
|---|---|
**kwargs
|
Keyword arguments to pass to
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
CalculatedChannel | None
|
The CalculatedChannel found or None. |
get
async
¶
get(
*,
calculated_channel_id: str | None = None,
client_key: str | None = None,
) -> CalculatedChannel
Get a Calculated Channel.
| PARAMETER | DESCRIPTION |
|---|---|
calculated_channel_id
|
The ID of the calculated channel.
TYPE:
|
client_key
|
The client key of the calculated channel.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CalculatedChannel
|
The CalculatedChannel. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If neither calculated_channel_id nor client_key is provided. |
list_
async
¶
list_(
*,
name: str | None = None,
names: list[str] | None = None,
name_contains: str | None = None,
name_regex: str | Pattern | None = None,
calculated_channel_ids: list[str] | None = None,
client_keys: list[str] | None = None,
created_after: datetime | None = None,
created_before: datetime | None = None,
modified_after: datetime | None = None,
modified_before: datetime | None = None,
created_by: Any | str | None = None,
modified_by: Any | str | None = None,
tags: list[Any] | list[str] | list[Tag] | None = None,
metadata: list[Any] | None = None,
asset: Asset | str | None = None,
run: Run | str | None = None,
version: int | None = None,
description_contains: str | None = None,
include_archived: bool = False,
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
) -> list[CalculatedChannel]
List calculated channels with optional filtering. This will return the latest version. To find all versions, use list_versions.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Exact name of the calculated channel.
TYPE:
|
names
|
List of calculated channel names to filter by.
TYPE:
|
name_contains
|
Partial name of the calculated channel.
TYPE:
|
name_regex
|
Regular expression string to filter calculated channels by name.
TYPE:
|
calculated_channel_ids
|
Filter to calculated channels with any of these IDs.
TYPE:
|
client_keys
|
Filter to calculated channels with any of these client keys.
TYPE:
|
created_after
|
Created after this date.
TYPE:
|
created_before
|
Created before this date.
TYPE:
|
modified_after
|
Modified after this date.
TYPE:
|
modified_before
|
Modified before this date.
TYPE:
|
created_by
|
Calculated channels created by this user.
TYPE:
|
modified_by
|
Calculated channels last modified by this user.
TYPE:
|
tags
|
Filter calculated channels with any of these Tags or tag names.
TYPE:
|
metadata
|
Filter calculated channels by metadata criteria.
TYPE:
|
asset
|
Filter calculated channels associated with this Asset or asset ID.
TYPE:
|
run
|
Filter calculated channels associated with this Run or run ID.
TYPE:
|
version
|
The version of the calculated channel.
TYPE:
|
description_contains
|
Partial description of the calculated channel.
TYPE:
|
include_archived
|
Include archived calculated channels.
TYPE:
|
filter_query
|
Explicit CEL query to filter calculated channels.
TYPE:
|
order_by
|
How to order the retrieved calculated channels.
TYPE:
|
limit
|
How many calculated channels to retrieve. If None, retrieves all matches.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[CalculatedChannel]
|
A list of CalculatedChannels that matches the filter. |
list_versions
async
¶
list_versions(
*,
calculated_channel: CalculatedChannel
| str
| None = None,
client_key: str | None = None,
name: str | None = None,
names: list[str] | None = None,
name_contains: str | None = None,
name_regex: str | Pattern | None = None,
created_after: datetime | None = None,
created_before: datetime | None = None,
modified_after: datetime | None = None,
modified_before: datetime | None = None,
created_by: Any | str | None = None,
modified_by: Any | str | None = None,
tags: list[Any] | list[str] | list[Tag] | None = None,
metadata: list[Any] | None = None,
description_contains: str | None = None,
include_archived: bool = False,
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
) -> list[CalculatedChannel]
List versions of a calculated channel.
| PARAMETER | DESCRIPTION |
|---|---|
calculated_channel
|
The CalculatedChannel or ID of the calculated channel to get versions for.
TYPE:
|
client_key
|
The client key of the calculated channel.
TYPE:
|
name
|
Exact name of the calculated channel.
TYPE:
|
names
|
List of calculated channel names to filter by.
TYPE:
|
name_contains
|
Partial name of the calculated channel.
TYPE:
|
name_regex
|
Regular expression string to filter calculated channels by name.
TYPE:
|
created_after
|
Filter versions created after this datetime.
TYPE:
|
created_before
|
Filter versions created before this datetime.
TYPE:
|
modified_after
|
Filter versions modified after this datetime.
TYPE:
|
modified_before
|
Filter versions modified before this datetime.
TYPE:
|
created_by
|
Filter versions created by this user or user ID.
TYPE:
|
modified_by
|
Filter versions modified by this user or user ID.
TYPE:
|
tags
|
Filter versions with any of these Tags or tag names.
TYPE:
|
metadata
|
Filter versions by metadata criteria.
TYPE:
|
description_contains
|
Partial description of the calculated channel.
TYPE:
|
include_archived
|
Include archived versions.
TYPE:
|
filter_query
|
Explicit CEL query to filter versions.
TYPE:
|
order_by
|
How to order the retrieved versions.
TYPE:
|
limit
|
Maximum number of versions to return. If None, returns all matches.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[CalculatedChannel]
|
A list of CalculatedChannel versions that match the filter criteria. |
unarchive
async
¶
unarchive(
calculated_channel: str | CalculatedChannel,
) -> CalculatedChannel
Unarchive a calculated channel.
| PARAMETER | DESCRIPTION |
|---|---|
calculated_channel
|
The id or CalculatedChannel object of the calculated channel to unarchive.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CalculatedChannel
|
The unarchived CalculatedChannel. |
update
async
¶
update(
calculated_channel: CalculatedChannel | str,
update: CalculatedChannelUpdate | dict,
*,
user_notes: str | None = None,
) -> CalculatedChannel
Update a Calculated Channel.
| PARAMETER | DESCRIPTION |
|---|---|
calculated_channel
|
The CalculatedChannel or id of the CalculatedChannel to update.
TYPE:
|
update
|
Updates to apply to the CalculatedChannel.
TYPE:
|
user_notes
|
User notes for the update.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CalculatedChannel
|
The updated CalculatedChannel. |