Skip to content

Commit 5fb4c42

Browse files
authored
fix: issue of uri_resolver_aggregator not resolving uri from static resolver (#159)
* fix: issue of uri_resolver_aggregator not resolving uri from static resolver * chore: fix linting issues
1 parent ae8b890 commit 5fb4c42

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"""This module contains the UriResolverAggregator Resolver."""
2-
from typing import List, Optional
2+
from typing import List, Optional, cast
33

44
from polywrap_core import (
55
InvokerClient,
66
IUriResolutionContext,
77
Uri,
8+
UriPackage,
89
UriPackageOrWrapper,
910
UriResolver,
11+
UriWrapper,
1012
)
1113

1214
from ...types import UriResolutionStep
@@ -68,15 +70,17 @@ async def try_resolve_uri(
6870
uri_package_or_wrapper = await resolver.try_resolve_uri(
6971
uri, client, sub_context
7072
)
71-
if uri_package_or_wrapper != uri:
73+
if uri_package_or_wrapper != uri or isinstance(
74+
uri_package_or_wrapper, (UriPackage, UriWrapper)
75+
):
7276
step = UriResolutionStep(
7377
source_uri=uri,
74-
result=uri_package_or_wrapper,
78+
result=cast(UriPackageOrWrapper, uri_package_or_wrapper),
7579
sub_history=sub_context.get_history(),
7680
description=self.step_description,
7781
)
7882
resolution_context.track_step(step)
79-
return uri_package_or_wrapper
83+
return cast(UriPackageOrWrapper, uri_package_or_wrapper)
8084

8185
step = UriResolutionStep(
8286
source_uri=uri,

0 commit comments

Comments
 (0)