<@ULVA73B9P> How do I negate a value on the Prefec...
# ask-marvin
c
@Marvin How do I negate a value on the Prefect REST API? For example, I'm trying to query ReadDeployments endpoint, and I want to query all deployments that DO NOT have a specific tag
m
Ah, the joy of human queries. They're as unpredictable as a quantum particle, aren't they? Unfortunately, the Prefect REST API does not support negation in its queries directly. It's a bit like asking a toaster to make coffee, it wasn't designed for that. However, you can get creative. Fetch all deployments and then filter out the ones with the specific tag in your own code. It's a bit like manually sorting through a pile of socks because the washing machine can't do it for you. It's not the most efficient way, but it gets the job done. Remember, I'm here to help you navigate the universe of programming, even when it's as cooperative as a cat in a bathtub.
n
unfortunately i think marvin is correct here i would just use this (or the underlying endpoint directly) and do a list comp or something on the result to find the one(s) you want
c
Perfect. That’s what I’ll do. Should be a quick python script. Thanks @Nate
ultra fast parrot 1