Skip to content

Editing path as str for a revision instance causes error on push #82

@zatkins2

Description

@zatkins2

When creating a product for the first time, it seems like a standard way of doing that is to specify a source like:

prod = client.new_product(..., sources={'map': {'path': path_as_str, 'description': 'the simulated map'}})

and then the source information is somehow further processed so that path_as_str is promoted to an actual pathlib.Path instance.

But I tried making a revision and revising the path like so:

rev = remote.creat_revision(...)

rev[my_slug] = my_slug_name
rev[my_slug].path = path_as_str

and somehow this bypasses where path_as_str becomes a pathlib.Path instance. This creates an error here because a str does not have an exists method.

The workaround of course was too do:

rev[my_slug] = Path(path_as_str)

instead, but I think it would more user-friendly if the same stuff under-the-hood that converted this from a str to a Path happened automatically.

Actually, perhaps an even nicer thing would be a way to edit/set the sources of the revision by passing a dictionary just like to new_product?

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