@@ -29,7 +29,9 @@ def test_drop_column_command_resources(destination_config: DestinationTestConfig
29
29
"""Test the drop command with resource and verify correct data is deleted from destination"""
30
30
source : Any = droppable_source ()
31
31
32
- pipeline = destination_config .setup_pipeline ("droppbale" , dev_mode = True )
32
+ pipeline = destination_config .setup_pipeline (
33
+ "test_drop_column_command_resources" , dev_mode = True
34
+ )
33
35
info = pipeline .run (source , ** destination_config .run_kwargs )
34
36
assert_load_info (info )
35
37
@@ -81,3 +83,37 @@ def test_drop_column_command_resources(destination_config: DestinationTestConfig
81
83
remaining_cols = pipeline .default_schema .get_table_columns (must_drop_info ["from_table" ])
82
84
for dropped_col in must_drop_info ["drop_columns" ]:
83
85
assert dropped_col not in remaining_cols
86
+
87
+
88
+ @pytest .mark .parametrize (
89
+ "destination_config" ,
90
+ destinations_configs (
91
+ default_sql_configs = True ,
92
+ local_filesystem_configs = True ,
93
+ all_buckets_filesystem_configs = True ,
94
+ table_format_local_configs = True ,
95
+ ),
96
+ ids = lambda x : x .name ,
97
+ )
98
+ def test_drop_column_from_child_table (destination_config : DestinationTestConfiguration ) -> None :
99
+ """Test the drop command with column and child table and verify correct data is deleted from destination"""
100
+ source : Any = droppable_source ()
101
+
102
+ pipeline = destination_config .setup_pipeline ("test_drop_column_from_child_table" , dev_mode = True )
103
+ info = pipeline .run (source , ** destination_config .run_kwargs )
104
+ assert_load_info (info )
105
+
106
+ original_parent_tbl_cols = pipeline .default_schema .get_table_columns ("droppable_b" )
107
+ assert "m" in pipeline .default_schema .get_table_columns ("droppable_b__items" )
108
+
109
+ drop_cmd = helpers .DropCommand (
110
+ pipeline , from_resources = ["droppable_b" ], from_tables = ["droppable_b__items" ], columns = ["m" ]
111
+ )
112
+ must_drop_infos = drop_cmd .from_tables_drop_cols
113
+
114
+ assert [{"from_table" : "droppable_b__items" , "drop_columns" : ["m" ]}] == must_drop_infos
115
+
116
+ drop_cmd ()
117
+
118
+ assert "m" not in pipeline .default_schema .get_table_columns ("droppable_b__items" )
119
+ assert original_parent_tbl_cols == pipeline .default_schema .get_table_columns ("droppable_b" )
0 commit comments