Skip to content

Added `yield_find`

Choose a tag to compare

@ksallee ksallee released this 14 Jan 19:52
· 11 commits to main since this release

Description

The wrapper for find is great, but you have to wait for all the results of the find to be ready with their query fields in order to get the results.
Introducing yield_find, which allows to yield results as soon as they're available.

Updated README with the two use cases:

# Find multiple shots (returns all results at once)
    shots = fpt.find(
        "Shot",
        [["id", "in", [1234, 12345]]],
        ["code", "sg_status_list", "sg_query_field"]
    )

    # Stream results one by one
    for shot in fpt.yield_find(
        "Shot",
        [["id", "in", [1234, 12345]]],
        ["code", "sg_status_list", "sg_query_field"]
    ):
        process_shot(shot)  # Process each shot as it becomes ready

What's Changed

New Contributors

Full Changelog: 0.1.2...0.2.0