-
Notifications
You must be signed in to change notification settings - Fork 135
Renaming Internal Structs #1059
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
Changes from 3 commits
80611e6
3c15d55
8affdc0
2529109
42daa1b
f995cb8
4200a39
580ecd5
03d3398
5eebc45
a669bcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,6 +102,7 @@ | |
|
|
||
| __all__ = [ | ||
| "Expr", | ||
| "RawExpr", | ||
| "Column", | ||
| "Literal", | ||
| "BinaryExpr", | ||
|
|
@@ -193,10 +194,15 @@ class Expr: | |
| :ref:`Expressions` in the online documentation for more information. | ||
| """ | ||
|
|
||
| def __init__(self, expr: expr_internal.Expr) -> None: | ||
| def __init__(self, expr: expr_internal.RawExpr) -> None: | ||
| """This constructor should not be called by the end user.""" | ||
| self.expr = expr | ||
|
|
||
| @property | ||
| def raw_expr(self) -> expr_internal.RawExpr: | ||
|
||
| """Returns the underlying RawExpr instance.""" | ||
| return self.expr | ||
|
|
||
| def to_variant(self) -> Any: | ||
| """Convert this expression into a python object if possible.""" | ||
| return self.expr.to_variant() | ||
|
|
@@ -383,7 +389,7 @@ def literal(value: Any) -> Expr: | |
| value = pa.scalar(value, type=pa.string_view()) | ||
| if not isinstance(value, pa.Scalar): | ||
| value = pa.scalar(value) | ||
| return Expr(expr_internal.Expr.literal(value)) | ||
| return Expr(expr_internal.RawExpr.literal(value)) | ||
|
|
||
| @staticmethod | ||
| def string_literal(value: str) -> Expr: | ||
|
|
@@ -398,13 +404,13 @@ def string_literal(value: str) -> Expr: | |
| """ | ||
| if isinstance(value, str): | ||
| value = pa.scalar(value, type=pa.string()) | ||
| return Expr(expr_internal.Expr.literal(value)) | ||
| return Expr(expr_internal.RawExpr.literal(value)) | ||
| return Expr.literal(value) | ||
|
|
||
| @staticmethod | ||
| def column(value: str) -> Expr: | ||
| """Creates a new expression representing a column.""" | ||
| return Expr(expr_internal.Expr.column(value)) | ||
| return Expr(expr_internal.RawExpr.column(value)) | ||
|
|
||
| def alias(self, name: str) -> Expr: | ||
| """Assign a name to the expression.""" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,9 +34,15 @@ def missing_exports(internal_obj, wrapped_obj) -> None: | |
| return | ||
|
|
||
| for attr in dir(internal_obj): | ||
| if attr in ["_global_ctx"]: | ||
| # Skip internal context and RawExpr (which is handled by Expr class) | ||
| if attr in ["_global_ctx", "RawExpr"]: | ||
| continue | ||
|
|
||
|
||
| # Check if RawExpr functionality is covered by Expr class | ||
| if attr == "RawExpr" and hasattr(wrapped_obj, "Expr"): | ||
| expr_class = getattr(wrapped_obj, "Expr") | ||
| assert hasattr(expr_class, "raw_expr"), "Expr class must provide raw_expr property" | ||
|
||
| continue | ||
| assert attr in dir(wrapped_obj) | ||
timsaucer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| internal_attr = getattr(internal_obj, attr) | ||
| wrapped_attr = getattr(wrapped_obj, attr) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing this caused the test to fail. I'll add this again and run the tests locally again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its removal is causing the tests to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added a line in the test: