Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form.select_columns needs a way to distinguish structural dots from dots in the names of record fields #3088

Open
jpivarski opened this issue Apr 19, 2024 · 0 comments
Labels
bug The problem described is something that must be fixed

Comments

@jpivarski
Copy link
Member

Version of Awkward Array

HEAD

Description and code to reproduce

Suppose you have an array like

>>> array = ak.Array([{"outer": {"crazy.dot": {"inner_a": 12.3, "inner_b": 123}}}])
>>> array.show(type=True)
type: 1 * {
    outer: {
        "crazy.dot": {
            inner_a: float64,
            inner_b: int64
        }
    }
}
[{outer: {'crazy.dot': {inner_a: 12.3, inner_b: 123}}}]

If you want to Form-select inner_a and not inner_b, you can't:

>>> array.layout.form.select_columns("outer.crazy.dot.inner_a")
RecordForm([], [])

When this problem is encountered in Spark, they use backticks. To do the same, we'd want

>>> array.layout.form.select_columns("outer.`crazy.dot`.inner_a")
RecordForm([], [])

to result in

RecordForm([RecordForm([RecordForm([NumpyForm('float64')], ['inner_a'])], ['crazy.dot'])], ['outer'])

which means a bit more parsing of the specifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The problem described is something that must be fixed
Projects
Finalization
P1 (highest)
Development

No branches or pull requests

1 participant