From 58f877bc9460b4fad21a67e8556427b9cc0fa5bf Mon Sep 17 00:00:00 2001 From: Ashish Mahendra Date: Fri, 29 Nov 2024 12:48:27 +0000 Subject: [PATCH] Support for from module import attribute Syntax --- jac-splice-orc/jac_splice_orc/plugin/splice_plugin.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jac-splice-orc/jac_splice_orc/plugin/splice_plugin.py b/jac-splice-orc/jac_splice_orc/plugin/splice_plugin.py index 96a9ce3de..51f7efefd 100644 --- a/jac-splice-orc/jac_splice_orc/plugin/splice_plugin.py +++ b/jac-splice-orc/jac_splice_orc/plugin/splice_plugin.py @@ -447,7 +447,16 @@ def jac_import( remote_module_proxy = proxy.get_module_proxy( module_name=target, module_config=module_config[target] ) - return (remote_module_proxy,) + if items: + imported_items = [] + for item_name, item_alias in items.items(): + item = getattr(remote_module_proxy, item_name) + if item_alias: + item.__name__ = item_alias + imported_items.append(item) + return tuple(imported_items) + else: + return (remote_module_proxy,) spec = ImportPathSpec( target, base_path,