Hi! In Prefect 2.0 - Python API orion client. How can we create and provide a flow_filter to read_deployments() ? For example how do I get all deployments that have a specific tag using Python? It would be nice if the API docs had more examples especially related to Python API and client
✅ 1
m
Mathijs Carlu
06/28/2022, 10:10 AM
The following looks for all deployments that are tagged "DeploymentHasThisTag":
from prefect.orion.schemas.filters import DeploymentFilter, DeploymentFilterTags
b = await client.read_deployments(deployment_filter=filter)
❤️ 1
Mathijs Carlu
06/28/2022, 10:11 AM
Might be useful to look at the REST API, where you can more easily "click open" the required contents, which are actually just json representations of the Python objects
a
Andreas
06/28/2022, 10:16 AM
Thanks that was what I was looking for!
a
Anna Geller
06/30/2022, 1:32 PM
cc @terrence feedback to have more examples on using Orion client
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.