| 
									
										
										
										
											2024-04-17 12:19:37 +02:00
										 |  |  | import sys | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import pytest | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from metadata.generated.schema.entity.data.table import Constraint, Table | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if not sys.version_info >= (3, 9): | 
					
						
							|  |  |  |     pytest.skip("requires python 3.9+", allow_module_level=True) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_pass( | 
					
						
							| 
									
										
										
										
											2024-06-17 08:56:28 +02:00
										 |  |  |     ingest_metadata, | 
					
						
							| 
									
										
										
										
											2024-04-17 12:19:37 +02:00
										 |  |  |     metadata, | 
					
						
							|  |  |  | ): | 
					
						
							| 
									
										
										
										
											2024-06-17 08:56:28 +02:00
										 |  |  |     table: Table = metadata.get_by_name( | 
					
						
							|  |  |  |         Table, | 
					
						
							|  |  |  |         f"{ingest_metadata.fullyQualifiedName.root}.AdventureWorks.HumanResources.Department", | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2024-04-17 12:19:37 +02:00
										 |  |  |     assert table is not None | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert table.columns[0].name.root == "DepartmentID" | 
					
						
							| 
									
										
										
										
											2024-04-17 12:19:37 +02:00
										 |  |  |     assert table.columns[0].constraint == Constraint.PRIMARY_KEY | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert table.columns[1].name.root == "Name" | 
					
						
							|  |  |  |     assert table.columns[2].name.root == "GroupName" | 
					
						
							|  |  |  |     assert table.columns[3].name.root == "ModifiedDate" |