Madison Schott

    Madison Schott

    2 months ago
    Is there a way to rename pipelines? Or "retire" them? We have the old
    data_pipeline_prod
    that we want to somehow label that it is deprecated? And then change the one with test in its name to the new
    data_pipeline_prod
    ? Or any suggested ways to do this?
    James Sopkin

    James Sopkin

    2 months ago
    Could you register your
    data_pipeline_test
    with the flow name of
    data_pipeline_prod
    and the prod project? Or do you need to keep the deprecated pipeline?
    Otherwise, I believe there is a task that can rename flows called RenameFlowRun() https://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/prefect/flow_run_rename.py
    Madison Schott

    Madison Schott

    2 months ago
    Ideally I'd like to keep the old one so we have that history
    Oh cool, I'll check that out!
    so do I import this and then run this task within an already existing flow?
    meaning I need to redploy the flow to include the task that renames?
    an answer to the above questions would be appeciated 🙂
    James Sopkin

    James Sopkin

    2 months ago
    Hi Madison, sorry, I don't monitor this channel as closely as Anna and Kevin do, I was just subbing in for them for a few days. I went and testing the flow_run_name method. A flow run can be renamed either by calling the FlowRunRename task in the flow and passing in the flow_run_id and new name
    with Flow("flow") as flow:
       FlowRunRename({id}, "new_name")
    or by making running a mutation query in the interactive api
    mutation {
      set_flow_run_name(input: {flow_run_id:{id}, name: "new_name"}) {
        success
      }
    }
    Unfortunately, this would only rename a single flow run, but not the flow itself. I believe it is possible to rename flow projects, but not rename a flow.
    I would recommend registering the test pipeline to the prod flow. The prod history will be maintained in the previous versions. Other than that, we could open an issue/feature request
    Madison Schott

    Madison Schott

    2 months ago
    Ah so it doesn't rename the entire flow? Just one run of it? (the first option)
    I was able to rename the project on the UI
    hmm I included it in the flow but it doesn't look like the task is showing up on the UI
    James Sopkin

    James Sopkin

    2 months ago
    I wrote a simple flow called test_rename_flow and renamed the flow to new_name
    Madison Schott

    Madison Schott

    2 months ago
    Ah so it's just that one run? Instead of the random animal name?
    James Sopkin

    James Sopkin

    2 months ago
    Madison Schott

    Madison Schott

    2 months ago
    Darn ok thanks