(expr, parent, dependents, additional_columns=None)
| 3953 | |
| 3954 | |
| 3955 | def plain_column_projection(expr, parent, dependents, additional_columns=None): |
| 3956 | column_union = determine_column_projection( |
| 3957 | expr, parent, dependents, additional_columns=additional_columns |
| 3958 | ) |
| 3959 | if isinstance(column_union, list): |
| 3960 | column_union = [col for col in expr.frame.columns if col in column_union] |
| 3961 | elif column_union not in expr.frame.columns: |
| 3962 | # we are accessing the index |
| 3963 | column_union = [] |
| 3964 | |
| 3965 | if column_union == expr.frame.columns or not column_union and expr.ndim < 2: |
| 3966 | # this projection is for the index, but the elements are unknown, so |
| 3967 | # don't project |
| 3968 | return |
| 3969 | result = type(expr)(expr.frame[column_union], *expr.operands[1:]) |
| 3970 | if column_union == parent.operand("columns"): |
| 3971 | return result |
| 3972 | return type(parent)(result, parent.operand("columns")) |
| 3973 | |
| 3974 | |
| 3975 | def is_filter_pushdown_available(expr, parent, dependents, allow_reduction=True): |
no test coverage detected