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

Optimize aggregate_field_name method in field_mappings #373

Merged
merged 2 commits into from Aug 6, 2021

Conversation

V1NAY8
Copy link
Contributor

@V1NAY8 V1NAY8 commented Aug 6, 2021

The method aggregatable_field_name has self._mappings_capabilities which is a dataframe.

We are querying dataframe 4 times per method call. Instead query it once and reuse the result.

Also this improves readability of the code.

@sethmlarson take a look

@elasticmachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@sethmlarson
Copy link
Contributor

jenkins test this please

@V1NAY8
Copy link
Contributor Author

V1NAY8 commented Aug 6, 2021

Now, this also closes #251

@sethmlarson
Copy link
Contributor

@V1NAY8 Could you separate these two feature contributions into different PRs? It's best to keep them separate so they don't get blocked on each other. I'd also like to have the ML change reviewed by someone else.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Thanks for this, a couple comments for you!

eland/field_mappings.py Show resolved Hide resolved
eland/query_compiler.py Outdated Show resolved Hide resolved
@V1NAY8 V1NAY8 force-pushed the optimize-aggregatable_name branch from 8fb3143 to e67fe67 Compare August 6, 2021 15:54
@V1NAY8 V1NAY8 requested a review from sethmlarson August 6, 2021 16:01
@sethmlarson
Copy link
Contributor

jenkins test this please

Copy link
Contributor

@sethmlarson sethmlarson 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!

@sethmlarson sethmlarson merged commit d3f8d7b into elastic:master Aug 6, 2021
@V1NAY8 V1NAY8 deleted the optimize-aggregatable_name branch August 6, 2021 17:13
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.

None yet

3 participants