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

fix: refuse dak.Array in hidden-but-public-functions #3079

Conversation

jpivarski
Copy link
Member

This is solution (3) from #3077 (comment), but I made it a "refuse if dask-awkward," rather than "convert if dask-awkward." They're hidden-but-public (L2) functions, so they can be restrictive. If dask-awkward ever does write overloads for them, those overloads can be a way to avoid this behavior (so we're not making decisions for dask-awkward).

To fix the ATLAS problem, Coffea will need to make an update, to be more careful about dak.Array versus dak.Array._meta.

@jpivarski jpivarski requested a review from agoose77 April 11, 2024 16:55
@jpivarski
Copy link
Member Author

My main question: are there other places in the code like this, which should have a similar dak-check?

I decided to go with type(x).__name__.startswith("dask_awkward."), rather than hasattr(x, "_meta"), since there may be other reasons why a non-dask-awkward array has an attribute named _meta. If class definitions get moved in dask-awkward, then this check should really be

type(x).__name__ == "dask_awkward" or type(x).__name__.startswith("dask_awkward.")

and maybe it should be a utility function.

If there's already a utility function that I just don't know about, please point me to it!

@jpivarski jpivarski merged commit 28d8917 into main Apr 20, 2024
41 checks passed
@jpivarski jpivarski deleted the jpivarski/careful-with-dak.Array-in-hidden-but-public-functions-2 branch April 20, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant