GreatEugenius commented on code in PR #373:
URL: https://github.com/apache/flink-agents/pull/373#discussion_r2621595028


##########
python/flink_agents/api/resource.py:
##########
@@ -73,23 +74,177 @@ def validate_serializable(self) -> "SerializableResource":
         return self
 
 
-class ResourceDescriptor:
-    """Descriptor of resource, includes the class and the initialize 
arguments."""
+class ResourceDescriptor(BaseModel):
+    """Descriptor for Resource instances, storing metadata for serialization 
and
+    instantiation.
 
-    _clazz: Type[Resource]
-    _arguments: Dict[str, Any]
-
-    def __init__(self, *, clazz: Type[Resource], **arguments: Any) -> None:
-        """Init method."""
-        self._clazz = clazz
-        self._arguments = arguments
+    Attributes:
+        python_clazz: The Python class name (e.g., 'YourResourceClass').
+        python_module: The Python module path (e.g., 'your.module.path').
+        java_clazz: The Java class full path (e.g., 
'com.example.YourJavaClass').
+                   Empty string for Python-only resources.
+        arguments: Dictionary containing resource initialization parameters.
+    """
+    python_clazz: str
+    python_module: str
+    java_clazz: str
+    arguments: Dict[str, Any]
+    _clazz: Type[Resource] | None = PrivateAttr(default=None)
+
+    def __init__(self, /,
+                 python_clazz: str | None = None,
+                 python_module: str | None = None,
+                 java_clazz: str | None = "",
+                 arguments: Dict[str, Any] | None = None,
+                 *,
+                 clazz: Type[Resource] | None = None,
+                 **kwargs: Dict[str, Any]) -> None:

Review Comment:
   I believe we need `python_clazz` and `java_clazz` for implementing 
cross-language resources. For instance, when using a Java resource in Python, 
the user registers the resource that corresponds to the wrapper's Class (Python 
Class) along with the actual Java resource being called (Java Class).



-- 
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