Hi team, I’m using `flytekit` to list projects, bu...
# ask-the-community
l
Hi team, I’m using
flytekit
to list projects, but it only gives me active projects, whereas with
flytectl
, I’m getting all projects by default and can filter for active projects with
--filter.fieldSelector "state=1"
Copy code
from flytekit.clients.friendly import SynchronousFlyteClient
from flytekit.configuration import Config
from flytekit.models.filters import Filter

client = SynchronousFlyteClient(Config.auto().platform)
print(client.list_projects_paginated())
How can I get all projects with
flytekit
?
I also tried to use filters, but maybe I’m not using it correctly.
Copy code
client.list_projects_paginated(filters=[Filter(key="fieldSelector", value="eq(state,1)")])
gives me
Copy code
unrecognized filter function: nil(fieldSelector,eq
s
Can you try
client.list_projects_paginated(filters=[Filter.from_python_std("eq(state,1)")])
?
150 Views