Skip to content

chore(typing): Ignore another EagerDataFrame intermittent [False Negative]#3142

Merged
MarcoGorelli merged 3 commits intomainfrom
eager-df-ignore-flaky
Oct 3, 2025
Merged

chore(typing): Ignore another EagerDataFrame intermittent [False Negative]#3142
MarcoGorelli merged 3 commits intomainfrom
eager-df-ignore-flaky

Conversation

@dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Sep 18, 2025

What type of PR is this? (check all applicable)

  • 💾 Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 🔧 Optimization
  • 📝 Documentation
  • ✅ Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

Been seeing this locally for a few days, but never in CI

image

@dangotbanned dangotbanned marked this pull request as ready for review September 18, 2025 17:13
@FBruzzesi
Copy link
Member

Out of curiosity, do you know why this is the case?

@dangotbanned
Copy link
Member Author

@FBruzzesi

Out of curiosity, do you know why this is the case?

Maybe related to https://discuss.python.org/t/unsoundness-of-contravariant-self-type/86338

But I guess to zoom in on it a bit more ...

I think the issue is EagerExprT gets bound in EagerDataFrame.aggregate - but then occasionally fails to be re-used for EagerDataFrame.select.

My intention for the typing is to say:

EagerDataFrame is generic over EagerDataFrame._expr: type[EagerExprT]
The type of EagerExprT should bind to the class

This is problematic because here that type is contravariant:

def select(self, *exprs: CompliantExprT_contra) -> Self: ...

But here that type is invariant:

def aggregate(self, *exprs: EagerExprT) -> Self:

... and then in EagerExpr itself, it depends on an invariant EagerDataFrame 😳:

class EagerExpr(
DepthTrackingExpr[EagerDataFrameT, EagerSeriesT],
Protocol[EagerDataFrameT, EagerSeriesT],
):
_call: EvalSeries[EagerDataFrameT, EagerSeriesT]
_scalar_kwargs: ScalarKwargs
def __init__(
self,
call: EvalSeries[EagerDataFrameT, EagerSeriesT],
*,
depth: int,
function_name: str,
evaluate_output_names: EvalNames[EagerDataFrameT],

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks!

@MarcoGorelli MarcoGorelli merged commit c1f8ad0 into main Oct 3, 2025
29 of 31 checks passed
@MarcoGorelli MarcoGorelli deleted the eager-df-ignore-flaky branch October 3, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants