Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"""This module contains the UriResolverAggregator Resolver."""
from typing import List, Optional
from typing import List, Optional, cast

from polywrap_core import (
InvokerClient,
IUriResolutionContext,
Uri,
UriPackage,
UriPackageOrWrapper,
UriResolver,
UriWrapper,
)

from ...types import UriResolutionStep
Expand Down Expand Up @@ -68,15 +70,17 @@ async def try_resolve_uri(
uri_package_or_wrapper = await resolver.try_resolve_uri(
uri, client, sub_context
)
if uri_package_or_wrapper != uri:
if uri_package_or_wrapper != uri or isinstance(
uri_package_or_wrapper, (UriPackage, UriWrapper)
):
step = UriResolutionStep(
source_uri=uri,
result=uri_package_or_wrapper,
result=cast(UriPackageOrWrapper, uri_package_or_wrapper),
sub_history=sub_context.get_history(),
description=self.step_description,
)
resolution_context.track_step(step)
return uri_package_or_wrapper
return cast(UriPackageOrWrapper, uri_package_or_wrapper)

step = UriResolutionStep(
source_uri=uri,
Expand Down