21
21
import datafusion .substrait
22
22
import pytest
23
23
24
+
25
+ IGNORED_EXPORTS = {"TableProvider" }
26
+
24
27
# EnumType introduced in 3.11. 3.10 and prior it was called EnumMeta.
25
28
try :
26
29
from enum import EnumType
@@ -36,6 +39,7 @@ def missing_exports(internal_obj, wrapped_obj) -> None: # noqa: C901
36
39
- Raw* classes: Internal implementation details that shouldn't be exposed
37
40
- _global_ctx: Internal implementation detail
38
41
- __self__, __class__, __repr__: Python special attributes
42
+ - TableProvider: Superseded by the public ``Table`` API in Python
39
43
"""
40
44
# Special case enums - EnumType overrides a some of the internal functions,
41
45
# so check all of the values exist and move on
@@ -50,6 +54,10 @@ def missing_exports(internal_obj, wrapped_obj) -> None: # noqa: C901
50
54
51
55
for internal_attr_name in dir (internal_obj ):
52
56
wrapped_attr_name = internal_attr_name .removeprefix ("Raw" )
57
+
58
+ if wrapped_attr_name in IGNORED_EXPORTS :
59
+ continue
60
+
53
61
assert wrapped_attr_name in dir (wrapped_obj )
54
62
55
63
internal_attr = getattr (internal_obj , internal_attr_name )
@@ -71,6 +79,8 @@ def missing_exports(internal_obj, wrapped_obj) -> None: # noqa: C901
71
79
# We have cases like __all__ that are a list and we want to be certain that
72
80
# every value in the list in the internal object is also in the wrapper list
73
81
for val in internal_attr :
82
+ if isinstance (val , str ) and val in IGNORED_EXPORTS :
83
+ continue
74
84
if isinstance (val , str ) and val .startswith ("Raw" ):
75
85
assert val [3 :] in wrapped_attr
76
86
else :
0 commit comments