From c5bb23b79e7628f61c3eb8c3f0938ffb54ccaf0f Mon Sep 17 00:00:00 2001 From: Niraj Kamdar Date: Thu, 13 Apr 2023 22:59:58 +0400 Subject: [PATCH 1/2] fix: issue of uri_resolver_aggregator not resolving uri from static resolver --- .../resolvers/aggregator/uri_resolver_aggregator.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py b/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py index 2dee37f4..8a6afacb 100644 --- a/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py +++ b/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py @@ -1,5 +1,5 @@ """This module contains the UriResolverAggregator Resolver.""" -from typing import List, Optional +from typing import List, Optional, cast from polywrap_core import ( InvokerClient, @@ -7,6 +7,8 @@ Uri, UriPackageOrWrapper, UriResolver, + UriPackage, + UriWrapper ) from ...types import UriResolutionStep @@ -68,15 +70,15 @@ 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, From 24b482edb8fa7b8e0bbee2b6bf1189a20050f19d Mon Sep 17 00:00:00 2001 From: Niraj Kamdar Date: Thu, 13 Apr 2023 23:04:54 +0400 Subject: [PATCH 2/2] chore: fix linting issues --- .../resolvers/aggregator/uri_resolver_aggregator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py b/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py index 8a6afacb..a49e9c49 100644 --- a/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py +++ b/packages/polywrap-uri-resolvers/polywrap_uri_resolvers/resolvers/aggregator/uri_resolver_aggregator.py @@ -5,10 +5,10 @@ InvokerClient, IUriResolutionContext, Uri, + UriPackage, UriPackageOrWrapper, UriResolver, - UriPackage, - UriWrapper + UriWrapper, ) from ...types import UriResolutionStep @@ -70,7 +70,9 @@ async def try_resolve_uri( uri_package_or_wrapper = await resolver.try_resolve_uri( uri, client, sub_context ) - if uri_package_or_wrapper != uri or isinstance(uri_package_or_wrapper, (UriPackage, UriWrapper)): + if uri_package_or_wrapper != uri or isinstance( + uri_package_or_wrapper, (UriPackage, UriWrapper) + ): step = UriResolutionStep( source_uri=uri, result=cast(UriPackageOrWrapper, uri_package_or_wrapper),