Michael-J-Ward commented on code in PR #782: URL: https://github.com/apache/datafusion-python/pull/782#discussion_r1693992444
########## python/datafusion/tests/test_wrapper_coverage.py: ########## @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import datafusion +import datafusion.functions +import datafusion.object_store +import datafusion.substrait + + +def missing_exports(internal_obj, wrapped_obj) -> None: + for attr in dir(internal_obj): + assert attr in dir(wrapped_obj) + + internal_attr = getattr(internal_obj, attr) + wrapped_attr = getattr(wrapped_obj, attr) + + assert wrapped_attr is not None if internal_attr is not None else True + + if attr in ["__self__", "__class__"]: + continue + if isinstance(internal_attr, list): + assert isinstance(wrapped_attr, list) + for val in internal_attr: + assert val in wrapped_attr + elif hasattr(internal_attr, "__dict__"): + missing_exports(internal_attr, wrapped_attr) + + +def test_datafusion_missing_exports() -> None: Review Comment: Love this test -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org