OpenMetadata/ingestion/tests/unit/utils/test_collaborative_super.py
Imri Paran b92b950060
Fix 18434: feat(statistics-profiler): use statistics tables to profile trino tables (#18433)
* feat(statistics-profiler): use statistics tables to profile trino tables

- implemented the collaborative root class
- added the "useStatistics" profiler parameter
- added the "supportsStatistics" database connection property
- implemented the ProfilerWithStatistics and StoredStatisticsSource to add this functionality to specific profilers
- implemented TrinoStoredStatisticsSource for specific trino statistics logic

* added ABC to terminal classes in collaborative root

* fixed docstring for TestSuiteInterface

* reverted unintended changes

* typo
2024-11-07 18:37:31 +01:00

40 lines
849 B
Python

import pytest
from metadata.utils.collaborative_super import Root
def test_collaborative_super():
class A(Root):
pass
class B(A):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.b = 2
class C(B):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.num = kwargs["num"]
c = C(num=10)
assert c.num == 10
def test_without_collaborative_super():
class A:
pass
class B(A):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.b = 2
class C(B):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.num = kwargs["num"]
with pytest.raises(TypeError):
C(num=10)