Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime flow name is not the actual flow name #16449

Open
jccalvojackson opened this issue Dec 19, 2024 · 1 comment
Open

runtime flow name is not the actual flow name #16449

jccalvojackson opened this issue Dec 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jccalvojackson
Copy link

jccalvojackson commented Dec 19, 2024

Bug summary

After renaming a flow, I would expect its runtime name to reflect this new given name. However, it returns the flow's function name.

from prefect import flow, runtime, serve


@flow(log_prints=True)
def test_flow():
    flow_name = runtime.flow_run.flow_name
    print(f"This should be 'renamed_flow' since it has been renamed but instead is: {flow_name}") # it prints 'test_flow'


if __name__ == "__main__":
    renamed_flow = test_flow.with_options(name="renamed_flow")
    deployment = renamed_flow.to_deployment(name="test_flow_name")
    serve(deployment)

In the ui it displays the correct given name

Screenshot 2024-12-19 at 3 23 08 PM

but the print above gives the flow's function name instead of the given name

Screenshot 2024-12-19 at 3 26 41 PM

Version info

Version:             3.1.7
API version:         0.8.4
Python version:      3.10.15
Git commit:          c05ffa6d
Built:               Mon, Dec 16, 2024 10:06 AM
OS/Arch:             darwin/arm64
Profile:             local
Server type:         server
Pydantic version:    2.7.4

@jccalvojackson jccalvojackson added the bug Something isn't working label Dec 19, 2024
@zzstoatzz
Copy link
Collaborator

zzstoatzz commented Dec 20, 2024

thanks for the issue and MRE - @jccalvojackson ! We'll take a look at this, this seems potentially related to #16312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants