Skip to content

Added implementation for ** operator, POWER and SQRT function #246

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

Merged
merged 6 commits into from
Feb 5, 2025

Conversation

vineetg3
Copy link
Contributor

@vineetg3 vineetg3 commented Feb 5, 2025

Resolves #218.
This PR adds implementation for ** operator, POWER and SQRT function. Please check issue for more details.

Copy link
Contributor

@knassre-bodo knassre-bodo left a comment

Choose a reason for hiding this comment

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

@vineetg3 Few minor comments, but the implementation LGTM!

@vineetg3 vineetg3 requested a review from knassre-bodo February 5, 2025 17:26
Copy link
Contributor

@knassre-bodo knassre-bodo left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@hadia206 hadia206 left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Minor comments.

@@ -62,7 +64,7 @@ Below is each binary operator currently supported in PyDough.
<!-- TOC --><a name="arithmetic"></a>
### Arithmetic

Supported mathematical operations: addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`).
Supported mathematical operations: addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`), exponentiation (`**`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add an example of its usage?

raw_args: Sequence[RelationalExpression] | None,
sql_glot_args: Sequence[SQLGlotExpression],
) -> SQLGlotExpression:

Copy link
Contributor

Choose a reason for hiding this comment

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

docstring missing?

@vineetg3 vineetg3 merged commit d82533d into main Feb 5, 2025
4 checks passed
@vineetg3 vineetg3 deleted the vineet/add_powr_sqrt branch February 5, 2025 18:37
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.

Add POWER and SQRT functions to PyDough, as well as runtime support for exponentiation
3 participants