Skip to content

[BUG] ListNamedEntity breaks when passing a filter with sortKey of created_at #2327

@pmahindrakar-oss

Description

@pmahindrakar-oss

Describe the bug

By default flytectl uses created_at as sort key when listing flyte entities

When making ListNamedEntities with workflow resource type , the current api breaks with the following error

 flytectl get workflow -p flytesnacks -d development                                  
Error: rpc error: code = Unknown desc = failed database operation with column "workflows.created_at" must appear in the GROUP BY clause or be used in an aggregate function

Similarly it breaks on passing a field selector too

flytectl get workflow -p flytesnacks -d development --filter.fieldSelector "state=0"
Error: rpc error: code = Unknown desc = failed database operation with column "workflows.created_at" must appear in the GROUP BY clause or be used in an aggregate function

It returns correctly in case of project, domain, name

 flytectl get workflow -p flytesnacks -d development --filter.fieldSelector "state=0" --filter.sortBy "project"
 --------------- ------------- ------------------------------------------------------------- ------------- ------- 
| PROJECT (45)  | DOMAIN      | NAME                                                        | DESCRIPTION | STATE |
 --------------- ------------- ------------------------------------------------------------- ------------- ------- 
| flytesnacks   | development | core.containerization.use_secrets.my_secret_workflow        |             |       |
 --------------- ------------- ------------------------------------------------------------- ------------- ------- 
| flytesnacks   | development | core.control_flow.chain_tasks.chain_tasks_wf                |             |       |
 --------------- ------------- ------------------------------------------------------------- ------------- ------- 

Expected behavior

Named Entities should be able to sorted by created_at

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes

Metadata

Metadata

Labels

bugSomething isn't workingflyteadminIssue for FlyteAdmin Servicestale

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions