@@ -1861,7 +1861,7 @@ def test_translate_column_names_missing_column_with_projected_field_mismatch() -
18611861 assert translated_expr == AlwaysFalse ()
18621862
18631863
1864- def test_translate_column_names_missing_column_projected_field_fallbacks_to_initial_default () -> None :
1864+ def test_translate_column_names_missing_column_projected_field_ignores_initial_default () -> None :
18651865 """Test translate_column_names when projected field value doesn't match but initial_default does."""
18661866 # Original schema with a field that has an initial_default
18671867 original_schema = Schema (
@@ -1889,33 +1889,3 @@ def test_translate_column_names_missing_column_projected_field_fallbacks_to_init
18891889
18901890 # Should evaluate to AlwaysFalse since projected field value doesn't match the expression literal
18911891 assert translated_expr == AlwaysFalse ()
1892-
1893-
1894- def test_translate_column_names_missing_column_projected_field_matches_initial_default_mismatch () -> None :
1895- """Test translate_column_names when both projected field value and initial_default doesn't match."""
1896- # Original schema with a field that has an initial_default that doesn't match the expression
1897- original_schema = Schema (
1898- NestedField (field_id = 1 , name = "existing_col" , field_type = StringType (), required = False ),
1899- NestedField (field_id = 2 , name = "missing_col" , field_type = IntegerType (), required = False , initial_default = 10 ),
1900- schema_id = 1 ,
1901- )
1902-
1903- # Create bound expression for the missing column
1904- unbound_expr = EqualTo ("missing_col" , 42 )
1905- bound_expr = visit (unbound_expr , visitor = BindVisitor (schema = original_schema , case_sensitive = True ))
1906-
1907- # File schema only has the existing column (field_id=1), missing field_id=2
1908- file_schema = Schema (
1909- NestedField (field_id = 1 , name = "existing_col" , field_type = StringType (), required = False ),
1910- schema_id = 1 ,
1911- )
1912-
1913- # Projected field value that matches the expression literal
1914- translated_expr = translate_column_names (
1915- bound_expr ,
1916- file_schema ,
1917- projected_field_values = {2 : 10 }, # This doesn't match expression literal (42)
1918- )
1919-
1920- # Should evaluate to AlwaysFalse since both projected field value and initial_default does not match
1921- assert translated_expr == AlwaysFalse ()
0 commit comments