mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-30 18:17:53 +00:00 
			
		
		
		
	 b92b950060
			
		
	
	
		b92b950060
		
			
		
	
	
	
	
		
			
			* 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
		
			
				
	
	
		
			40 lines
		
	
	
		
			849 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			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)
 |