ntjohnson1 commented on code in PR #1473:
URL: 
https://github.com/apache/datafusion-python/pull/1473#discussion_r3040687900


##########
python/datafusion/context.py:
##########
@@ -1105,14 +1122,38 @@ def register_udf(self, udf: ScalarUDF) -> None:
         """Register a user-defined function (UDF) with the context."""
         self.ctx.register_udf(udf._udf)
 
+    def deregister_udf(self, name: str) -> None:
+        """Remove a user-defined scalar function from the session.
+
+        Args:
+            name: Name of the UDF to deregister.
+        """
+        self.ctx.deregister_udf(name)
+
     def register_udaf(self, udaf: AggregateUDF) -> None:
         """Register a user-defined aggregation function (UDAF) with the 
context."""
         self.ctx.register_udaf(udaf._udaf)
 
+    def deregister_udaf(self, name: str) -> None:
+        """Remove a user-defined aggregate function from the session.
+
+        Args:
+            name: Name of the UDAF to deregister.
+        """
+        self.ctx.deregister_udaf(name)
+
     def register_udwf(self, udwf: WindowUDF) -> None:
         """Register a user-defined window function (UDWF) with the context."""
         self.ctx.register_udwf(udwf._udwf)
 
+    def deregister_udwf(self, name: str) -> None:

Review Comment:
   For all these deregister calls I assume they are for long running sessions 
and people aren't regularly registering and unregistering in quick succession. 
If they were then a context manager might be nice to manage scoped lifetimes. 
Probably out of scope for here or unless someone asks for it.



##########
python/datafusion/context.py:
##########
@@ -568,6 +568,15 @@ def register_object_store(
         """
         self.ctx.register_object_store(schema, store, host)
 
+    def deregister_object_store(self, schema: str, host: str | None = None) -> 
None:
+        """Remove an object store from the session.
+
+        Args:
+            schema: The data source schema (e.g. ``"s3://"``).

Review Comment:
   Would be nice to add this `(e.g.` to the register variant as well. 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to