djanand commented on code in PR #1866:
URL: 
https://github.com/apache/datafusion-ballista/pull/1866#discussion_r3411736758


##########
python/python/tests/test_context.py:
##########
@@ -138,3 +138,33 @@ def test_write_json(ctx, tmp_path):
     df.write_json(out_dir)
     json_files = list((tmp_path / "out").glob("*.json"))
     assert len(json_files) > 0
+
+
+def test_distributed_dataframe_wraps_dataframe_returning_methods():
+    from ballista.extension import DistributedDataFrame, DataFrame
+
+    should_be_wrapped = {
+        name
+        for name, val in DataFrame.__dict__.items()
+        if callable(val)
+        and not name.startswith("__")
+        and val.__annotations__.get("return") == DataFrame.__name__
+    }
+
+    assert should_be_wrapped
+    assert should_be_wrapped.issubset(DistributedDataFrame.__dict__)
+

Review Comment:
   makes sense. Moved it to a common fn.



##########
python/python/tests/test_context.py:
##########
@@ -138,3 +138,33 @@ def test_write_json(ctx, tmp_path):
     df.write_json(out_dir)
     json_files = list((tmp_path / "out").glob("*.json"))
     assert len(json_files) > 0
+
+
+def test_distributed_dataframe_wraps_dataframe_returning_methods():
+    from ballista.extension import DistributedDataFrame, DataFrame
+
+    should_be_wrapped = {
+        name
+        for name, val in DataFrame.__dict__.items()
+        if callable(val)
+        and not name.startswith("__")
+        and val.__annotations__.get("return") == DataFrame.__name__
+    }
+
+    assert should_be_wrapped
+    assert should_be_wrapped.issubset(DistributedDataFrame.__dict__)
+

Review Comment:
   @coderfender makes sense. Moved it to a common fn.



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