Skip to main content

get_flat_dependant

Recursively flattens a dependency tree into a single Dependant object by aggregating parameters and OAuth scopes from all sub-dependencies. It manages circular or repeated dependencies using a cache key and tracks nested security scopes throughout the hierarchy.

def get_flat_dependant(
dependant: Dependant,
skip_repeats: bool = False,
visited: list[DependencyCacheKey] | None = None,
parent_oauth_scopes: list[str] | None = None
) - > Dependant

Flattens a dependency tree into a single Dependant object by recursively merging parameters and OAuth scopes from all sub-dependencies.

Parameters

NameTypeDescription
dependantDependantThe root dependency object to begin flattening from.
skip_repeatsbool = FalseIf true, prevents the redundant processing of dependencies that have already been visited in the current tree.
visited`list[DependencyCacheKey]None` = None
parent_oauth_scopes`list[str]None` = None

Returns

TypeDescription
DependantA new Dependant instance containing the aggregated parameters and nested dependencies from the entire dependency graph.