Skip to content

get_all_collections only goes one level deeper #1360

@387809109

Description

@387809109

I was trying to call get_all_collections to recursively get all collections within a root catalog. It turned out that only collections of the root catalog and its direct children are returned.

Looking at the code

def get_all_collections(self) -> Iterable[Collection]:

def get_all_collections(self) -> Iterable[Collection]:
    """Get all collections from this catalog and all subcatalogs. Will traverse
    any subcatalogs recursively."""
    yield from self.get_collections()
    for child in self.get_children():
        yield from child.get_collections()

It seems that it's expected to only return collections from self and children.

Is it intentional or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions