Skip to content

Better dynamic append_name function. #648

@utf

Description

@utf

I would make a new update_name method that has more functionalities:

  • Update the name without adding prefix/suffix (this is already available if you just do some_job.name = 'mynewname', but not in a dynamic way)
  • Filters similar to update_metadata and others

API of this method could be:

def update_metadata(
        self,
        newname: str | None = None,
        prefix: str | None = None,
        suffix: str | None = None,
        name_filter: str = None,
        function_filter: Callable = None,
        dynamic: bool = True,
    ):

Then the append_name can just be used by this method if prefix and/or suffix is provided. (and the dynamic in append_name is not needed, I guess it would be better/less confusing if it is only in one place)

Not sure if it is absolutely essential, but it would make thing consistent with the rest of the update_* methods. (and I guess it would not be a huge work but again, it's all a matter of "is it needed and worth it if there is no use case right now ?")

Originally posted by @davidwaroquiers in #644 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions