https://prefect.io logo
Title
m

Miguel Moncada

03/29/2023, 3:26 PM
Hi team! I have a parent flow that calls different subflows. I'd like the graph displayed on the UI to be as meaningful as possible, allowing to identify flow/task runs in this diagram instead of having autogenerated names like
noisy-capuchin
Is this possible? if so, how would you recommend proceeding? Thanks a lot in advance! 🙇
I've tried setting the
flow_run_name
but it does not change the names displayed on the graph FYI (not sure what these correspond to TBH)
d

Dominic Tarro

03/29/2023, 3:39 PM
my_flow.with_options(flow_run_name="meaningful name")(*params)
m

Miguel Moncada

03/29/2023, 3:39 PM
see for instance:
image.png
The
get_file_subflow
flow run name was changed but I suppose what's being reflected on the timeline diagram is something else 🤔
d

Dominic Tarro

03/29/2023, 3:41 PM
Would have to look into the UI code to determine what's being displayed on the graph. If
Flow.with_options
isn't working then create an Issue on the GitHub repository
m

Miguel Moncada

03/29/2023, 3:44 PM
It'd be nice to know what these values are intended to correspond to before flagging this as an issue IMHO
d

Dominic Tarro

03/29/2023, 3:54 PM
Works fine with
flow.with_options
👀 1
m

Miguel Moncada

03/29/2023, 4:04 PM
it is not working for me, I'll try upgrading my Prefect Orion version to the latest, what version are you using?
I'm upgrading to
2.8.7
will keep you posted
d

Dominic Tarro

03/29/2023, 4:18 PM
Version: 2.8.7 API version: 0.8.4 Python version: 3.9.12
👌 1
m

Miguel Moncada

03/29/2023, 4:19 PM
great, I think it might be related to versioning. I'm having other issues with the upgrade for my agent though so I cannot test this just yet
1
@Dominic Tarro should it be this way?
import_file_uri = get_import_file.with_options(
   flow_run_name=f"get_file_{exc_date}")()
I'm getting
Finished in state Failed("Flow run encountered an exception. TypeError: with_options() got an unexpected keyword argument 'flow_run_name'\n")
d

Dominic Tarro

03/29/2023, 5:22 PM
Is that a flow or a task?
m

Miguel Moncada

03/29/2023, 5:23 PM
it's a flow
@flow(
    name="get_file_subflow",
)
def get_import_file(
) -> list:
import_file_uri = get_import_file.with_options(
   name=f"get_file_{exc_date}")()
does not make it break but I need
flow_run_name
I'm now using Orion v 2.8.7 and the Agent and runner are also using this version
d

Dominic Tarro

03/29/2023, 6:16 PM
I can't speak to why
flow_run_name
isn't working. https://github.com/PrefectHQ/prefect/blob/main/tests/test_flows.py Here are the unit tests for flows. Try mimicking some inside of your flow. For example
get_import_file_with_options = get_import_file.with_options(
   flow_run_name=f"get_file_{exc_date}")

print(get_import_file.flow_run_name, get_import_file_with_options.flow_run_name)
In the toughest situations I might go into the
prefect
library installed in my virtual environment and add print statements down the expected chain of events, looking for where things deviate from expected.
👍 1
m

Miguel Moncada

03/31/2023, 2:26 PM
thanks for your assistance @Dominic Tarro, this is not critical for now, I'll come back to it at some point, I guess.
it's working now in my Prefect Cloud deployment FYI
🙌 2