-
Notifications
You must be signed in to change notification settings - Fork 131
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 4 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 @@ | |
: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 @@ | |
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 @@ | |
""" | ||
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 |
---|---|---|
|
@@ -36,7 +36,12 @@ | |
for attr in dir(internal_obj): | ||
if attr in ["_global_ctx"]: | ||
continue | ||
assert attr in dir(wrapped_obj) | ||
timsaucer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
# Check if Raw* classes have corresponding wrapper classes | ||
if attr.startswith("Raw"): | ||
base_class = attr[3:] # Remove "Raw" prefix | ||
assert hasattr(wrapped_obj, base_class), f"Missing implementation for {attr}" | ||
continue | ||
|
||
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: