Skip to content
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

Add Default Precision 0 to ROUND Function #276

Open
vineetg3 opened this issue Feb 21, 2025 · 0 comments
Open

Add Default Precision 0 to ROUND Function #276

vineetg3 opened this issue Feb 21, 2025 · 0 comments

Comments

@vineetg3
Copy link
Contributor

Description:

Currently, the ROUND function in PyDough requires the user to explicitly provide a precision argument. However, Python's built-in round() function defaults to a precision of 0 when no precision is specified. To ensure consistency and make the ROUND function more user-friendly, its behavior should be updated to align with Python's round() by defaulting the precision to 0.

Proposed Solution:

  • Update the ROUND function implementation to make the precision argument optional.
  • If no precision is provided, default to 0.

Example:

Current Behavior:

ROUND(expression, 0)  # Users must explicitly provide the precision, e.g., 0 for rounding to the nearest integer.

New Behavior:

ROUND(expression)  # Defaults to ROUND(expression, 0)
  • Ensure that this change is reflected in the documentation.
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

No branches or pull requests

1 participant