Skip to content

engine: Impure APIs don't work with lists #7789

Closed

Description

@sipsma

Another tangential issue I noticed during adventures with #7767

An impure dagql API that has a list return value in the chain does not appear to work correctly.

Because it's impure, the query will be re-evaluated if submitted to the server again. However, if there were selections on the list, then the ID for the query will still include nth fields in that ID, but using the nth values from the first call to the API.

That seems like a bug because when you re-run the impure API:

  1. there's no guarantee the order of the results are the same, so you could be selecting nth on different results every time
  2. there's no guarantee the size of the list of the results are the same, so you could be trying to select an nth value beyond the size of the list

I don't know if there's any core APIs today that have this problem, but I did hit it in #7767. While I had a workaround there that I ended up wanting to follow for additional reasons, this seems like sort of a ticking time bomb for when we want an API with this behavior.

cc @vito

Activity

  1. added
    kind/bug
    area/engine
    on Jun 29, 2024
  2. added this to the next milestone on Jun 29, 2024
  3. sipsma commented on Jul 7, 2025

    @sipsma
    ContributorAuthor

    Believe this was fixed by #10410 and #10620. Now dagql lists are evaluated and then elements selected from that list. Also, since this issue was created Impure was broken down into finer grain cache keys; the closest equivalent is DoNotCache but that should only evaluate the list as a whole once per-query-submission now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/enginekind/bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions