Skip to content

add support for math database functions #45

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 1 commit into from
Jun 5, 2024

Conversation

timgraham
Copy link
Collaborator

No description provided.

@timgraham timgraham force-pushed the math-funcs branch 3 times, most recently from d946448 to dae3e31 Compare June 5, 2024 15:42
@timgraham timgraham marked this pull request as ready for review June 5, 2024 15:51
@timgraham timgraham requested review from WaVEV and Jibola June 5, 2024 15:51
def func(self, compiler, connection):
lhs_mql = process_lhs(self, compiler, connection)
try:
operator = MONGO_OPERATORS[self.__class__]
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 it can be done with get:
operator = MONGO_OPERATORS.get(self.__class__, self.function.lower())

@@ -54,12 +54,20 @@ class DatabaseFeatures(BaseDatabaseFeatures):
"lookup.tests.LookupTests.test_pattern_lookups_with_substr",
# Querying ObjectID with string doesn't work.
"lookup.tests.LookupTests.test_lookup_int_as_str",
# MongoDB gives the wrong result of log(number, base) when base is a
# fractional Decimal.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# fractional Decimal.
# fractional Decimal. https://jira.mongodb.org/browse/SERVER-91223

Copy link
Contributor

@Jibola Jibola left a comment

Choose a reason for hiding this comment

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

LGTM after the minor changes

@timgraham timgraham requested a review from Jibola June 5, 2024 19:27
Copy link
Contributor

@Jibola Jibola left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for getting this in

@timgraham timgraham merged commit fa3ef6e into mongodb:main Jun 5, 2024
3 checks passed
@timgraham timgraham deleted the math-funcs branch June 5, 2024 20:46
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