vishal-firgan-ksolves commented on code in PR #11095:
URL: https://github.com/apache/nifi/pull/11095#discussion_r3041033273


##########
nifi-framework-bundle/nifi-framework-extensions/nifi-py4j-framework-bundle/nifi-python-framework/src/main/python/framework/ProcessorInspection.py:
##########
@@ -268,6 +277,14 @@ def get_imported_property_descriptors_from_ast(root_node: 
ast.AST, module_file:
         if imported_name in source_descriptors:
             imported_descriptors[imported_name] = 
source_descriptors[imported_name]
             logger.debug(f"Resolved imported PropertyDescriptor 
'{imported_name}' from {source_file}")
+        else:
+            # The imported name is not itself a PropertyDescriptor (e.g. it is 
a class).
+            # Expose all PropertyDescriptors found in that source module so 
that
+            # attribute-style references like ParentClass.MY_PROP can be 
resolved.
+            for desc_name, desc in source_descriptors.items():
+                if desc_name not in imported_descriptors:
+                    imported_descriptors[desc_name] = desc
+                    logger.debug(f"Resolved PropertyDescriptor '{desc_name}' 
from class '{imported_name}' in {source_file}")

Review Comment:
   @pvillard31, makes sense, updated the caching and import resolution 
accordingly to avoid leaking unrelated descriptors, while keeping class imports 
intact.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to