Skip to content

Asset: clone() doesn't clone extra_fields #820

@m-mohr

Description

@m-mohr

If you do asset.clone() you get a shallow copy, but as extra_field is explicitily a member of the class, I'd expect that it at least also get cloned.

The following code adds abc to both asset and mask, which is somewhat unexpected:

fields = {}
asset = Asset(
    href=href,
    extra_fields=fields,
)
mask = asset.clone()
mask.extra_fields["abc"] = True

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThings which are broken

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions