Thread
#prefect-community
    i

    itay livni

    2 years ago
    Hello again - I have a question regarding
    tags
    . I am trying to retrieve a
    pd.DataFrame
    from the result of a
    merge
    . Like so:
    definitions = get_defs_flow.get_tasks(tags={"final_definitions"})#[1]
    definitions_df = get_defs_state.result[definitions].result
    The
    tag
    in the
    Flow
    looks like this:
    with tags("final_definitions"):
            definitions_df = merge(df1, df2)
    When
    df1
    is the result of the
    merge
    a
    list
    is returned with
    merge
    as the first item in the
    list
    .
    [<Task: Merge>, <Task: GetItem>]
    When
    df2
    is the result of the
    merge
    a
    list
    is returned with
    merge
    as the second item in the
    list
    .
    [<Task: GetItem>, <Task: Merge>]
    How do I explicitly call the
    merge
    result? Thanks I could loop through the list and get a
    df
    but that would be a coding travesty 🙂
    Chris White

    Chris White

    2 years ago
    Hey @itay livni! You might try filtering on both the tag and the name:
    definitions = get_defs_flow.get_tasks(tags={"final_definitions"}, name="Merge")
    i

    itay livni

    2 years ago
    Thanks. Works.