def METHOD_NAME():
    form = ak.Array(
        [
            {
                "x": [
                    {
                        "y": {
                            "z": [1, 2, 3],
                            "w": 4,
                        }
                    }
                ]
            }
        ]
    ).layout.form
    assert form.select_columns(
        ["x.y.q"], prune_unions_and_records=True
    ) == ak.forms.from_dict(
        {
            "class": "RecordArray",
            "fields": [],
            "contents": [],
        }
    )
    union_form = ak.forms.from_dict(
        {
            "class": "UnionArray",
            "tags": "i8",
            "index": "i64",
            "contents": [
                {"class": "RecordArray", "fields": ["x"], "contents": ["int64"]},
                {"class": "RecordArray", "fields": ["y"], "contents": ["int64"]},
            ],
        }
    )
    assert (
        union_form.select_columns("z", prune_unions_and_records=True)
        == ak.forms.EmptyForm()
    )