https://prefect.io logo
Title
i

itay livni

01/25/2020, 4:39 PM
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 🙂
c

Chris White

01/25/2020, 5:41 PM
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

01/26/2020, 1:49 AM
Thanks. Works.