Skip to content

Conversation

@loicdiridollou
Copy link
Member

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added (Please use assert_type() to assert the type of any return value)
  • If I used AI to develop this pull request, I prompted it to follow AGENTS.md.

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

I am not familar with the things under computation in this PR. May I invite @Dr-Irv to review?

Comment on lines 3 to 15
class AbstractEngine(metaclass=abc.ABCMeta):
has_neg_frac: bool = ...
expr = ...
aligned_axes = ...
result_type = ...
def __init__(self, expr) -> None: ...
def convert(self) -> str: ...
def evaluate(self) -> object: ...

class NumExprEngine(AbstractEngine):
has_neg_frac: bool = ...

class PythonEngine(AbstractEngine):
has_neg_frac: bool = ...
Copy link
Contributor

Choose a reason for hiding this comment

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

These are not documented. Can they be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to do the minimum to make the ANN pass, we could do a second round of cutting to drop some of the elements that are unused. Open to it

Copy link
Collaborator

Choose a reason for hiding this comment

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

delete this file. Nothing in here is documented.

@loicdiridollou loicdiridollou changed the title Clean up annotations for undocumented elements TYP: Clean up annotations for undocumented elements Dec 17, 2025
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

I think most of the files in core/computation can be deleted EXCEPT class Expr in expr.pyi

That ends up being needed by read_hdf so give that a try.

Comment on lines 3 to 15
class AbstractEngine(metaclass=abc.ABCMeta):
has_neg_frac: bool = ...
expr = ...
aligned_axes = ...
result_type = ...
def __init__(self, expr) -> None: ...
def convert(self) -> str: ...
def evaluate(self) -> object: ...

class NumExprEngine(AbstractEngine):
has_neg_frac: bool = ...

class PythonEngine(AbstractEngine):
has_neg_frac: bool = ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

delete this file. Nothing in here is documented.

from pandas.core.computation.ops import Term as Term
from pandas.core.computation.scope import Scope as Scope

class BaseExprVisitor(ast.NodeVisitor):
Copy link
Collaborator

Choose a reason for hiding this comment

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

delete this class. Only referenced in pytables to create other classes that are not documented

def visit_Compare(self, node, **kwargs: Any): ...
def visit_BoolOp(self, node, **kwargs: Any): ...

class Expr:
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to keep this one because it is superclass of PyTablesExpr which is same as Term which is arguments for read_hdf()

Now we don't document what Term is, but safer to leave it in for now

def __init__(self, name, is_local: bool = ...) -> None: ...
class UndefinedVariableError(NameError): ...

class Term:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tihnk Term can be deleted

class Constant(Term):
@property
def name(self): ...
class Constant(Term): ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

can be deleted

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, can be deleted

def name(self): ...
class Constant(Term): ...

class Op:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that this and its subclasses can be deleted

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can be deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

PyTables is used in pandas/io/pytables.pyi so could not delete the file in full but dropped most of it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this file can be deleted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

can delete this file as well

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually Scope is used in expr file (everything is so spread around this folder).

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

I find more places that can be deleted. But if the purpose is just to remove untyped methods, I can approve.

I don't see anything removed that shouldn't be.

Thank you @loicdiridollou !

def prune(self, klass): ...
class UnaryOp(ops.UnaryOp): ...

class PyTablesExprVisitor(BaseExprVisitor):
Copy link
Contributor

Choose a reason for hiding this comment

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

This one isn't referred to anywhere else.


class UnaryOp(ops.UnaryOp):
def prune(self, klass): ...
class UnaryOp(ops.UnaryOp): ...
Copy link
Contributor

Choose a reason for hiding this comment

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

This one isn't referred to anywhere else.

def format(self): ...
condition = ...

class JointConditionBinOp(ConditionBinOp):
Copy link
Contributor

Choose a reason for hiding this comment

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

This one isn't referred to anywhere else.

class JointFilterBinOp(FilterBinOp):
def format(self) -> None: ...

class ConditionBinOp(BinOp):
Copy link
Contributor

Choose a reason for hiding this comment

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

This one isn't referred to anywhere else.

def format(self): ...
def generate_filter_op(self, invert: bool = ...): ...

class JointFilterBinOp(FilterBinOp):
Copy link
Contributor

Choose a reason for hiding this comment

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

This one isn't referred to anywhere else.

class Constant(Term):
def __init__(self, name, env: PyTablesScope, side=..., encoding=...) -> None: ...

class BinOp(ops.BinOp):
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is referred to only in classes that are not referred to. Can also be removed, I believe.

class Constant(Term):
@property
def name(self): ...
class Constant(Term): ...
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, can be deleted

@cmp0xff
Copy link
Contributor

cmp0xff commented Dec 18, 2025

Please merge main so we can proceed.

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

I've double checked after merging main.

@cmp0xff cmp0xff merged commit 409875c into pandas-dev:main Dec 18, 2025
16 checks passed
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