-
Notifications
You must be signed in to change notification settings - Fork 11
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
CSV-5225: ignore nested documents that exceeds nested_objects_limit #2025
CSV-5225: ignore nested documents that exceeds nested_objects_limit #2025
Conversation
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.
Thanks Sawy for making it more generic for any nested field! Just requested a few minor changes.
# pm_tt2 = pm.annotations('task').select{|t| t.team_task_id == tt2.id}.last | ||
# pm_tt2.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_aa' }.to_json }.to_json | ||
# pm_tt2.save! | ||
# pm_tt3 = pm.annotations('task').select{|t| t.team_task_id == tt3.id}.last | ||
# pm_tt3.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_aaa' }.to_json }.to_json | ||
# pm_tt3.save! |
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.
Why these are commented? If not relevant, can't you just delete them?
# pm_tt3.save! | ||
sleep 2 | ||
es = $repository.find(pm.get_es_doc_id) | ||
pp es['task_responses'] |
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.
Please delete this debugging line if you don't need it.
pm = create_project_media team: team | ||
stub_configs({ 'nested_objects_limit' => 2 }) do | ||
# answer single choice | ||
puts "Start to answer" |
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.
Please delete this debugging line if you don't need it.
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.
OK will do
@@ -82,6 +82,7 @@ def get_fresh_value(data) | |||
|
|||
def add_update_nested_obj(options) | |||
return if self.disable_es_callbacks || RequestStore.store[:disable_es_callbacks] | |||
return if options[:op] == 'create' && self.respond_to?(:hit_nested_objects_limit?) && self.hit_nested_objects_limit? |
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.
Question: Only happens when the operation is "create"?
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.
yes as create add a new object to nested_object
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.
Thanks Sawy, good to go once the test is fixed.
# TODO: fix the test | ||
# assert_equal 2, task_responses.size |
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.
Good to go once this test is fixed.
…2025) * CSV-5225: ignore nested documents that exceeds nested_objects_limit * CV2-5225: add tests * CV2-5225: cleanup * CV2-5225: apply nested_objects_limit on tags and requests
Description
Ignore nested documents that exceeds nested_objects_limit which by default
10.000
.I limit this condition to tags and requests nested objects.
References: CSV-5225
How has this been tested?
Implemented automated tests.
Things to pay attention to during code review
Please describe parts of the change that require extra attention during code review, for example:
Checklist