Skip to content

fix: first maybe materialize, then check for PlaceholderArray#3566

Merged
pfackeldey merged 1 commit intomainfrom
pfackeldey/fix_materialization_order
Jul 6, 2025
Merged

fix: first maybe materialize, then check for PlaceholderArray#3566
pfackeldey merged 1 commit intomainfrom
pfackeldey/fix_materialization_order

Conversation

@pfackeldey
Copy link
Copy Markdown
Collaborator

This was a logical error. First, we have to materialize if it's a VirtualArray, then we should check for PlaceholderArrays. Otherwise we won't catch the case where a VirtualArray would materialize into a PlaceholderArray...

@ikrommyd
Copy link
Copy Markdown
Collaborator

ikrommyd commented Jul 3, 2025

I never actually expected virtual arrays to materialize into placeholders in the first place, that's why I didn't do it. I thought the assertion was higher in priority (if it's a placeholder, stop now and don't run any extra lines of code).

@ikrommyd
Copy link
Copy Markdown
Collaborator

ikrommyd commented Jul 3, 2025

Materializing into placeholder doesn't work by construction:

array = self._nplike.asarray(self._generator())
. I guess we may want this at some point in our lives so we better move the assertion now?

@pfackeldey
Copy link
Copy Markdown
Collaborator Author

Whether it's useful or not to materialize a PlaceholderArray is a different question. In any case, I think we should aim for logical correctness here, that's what this PR does. I'm not sure yet what we do in future with PlaceholderArrays and VirtualArrays interaction, but that doesn't stop us from making this correct already now.

@pfackeldey pfackeldey requested a review from ianna July 3, 2025 21:32
Copy link
Copy Markdown
Member

@ianna ianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfackeldey - Good catch! Thank you for fixing it!

@ianna
Copy link
Copy Markdown
Member

ianna commented Jul 6, 2025

@pfackeldey - please, feel free to merge it if you are done with it. Thanks!

@pfackeldey pfackeldey merged commit a611964 into main Jul 6, 2025
43 checks passed
@pfackeldey pfackeldey deleted the pfackeldey/fix_materialization_order branch July 6, 2025 17:13
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.

3 participants