-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fix missing docs.count #91
base: master
Are you sure you want to change the base?
Conversation
Our Elastic cluster has a number of indexes that don't return this value. The indexes do appear to be empty as well from looking at the indexes in elastic. This is the for example is what is in item: {'health': 'green', 'status': 'open', 'index': '<my index>', 'uuid': 't_w0eDA9SXS8CGYhYtXhfg', 'pri': '1', 'rep': '1', 'docs.count': None, 'docs.deleted': None, 'store.size': None, 'pri.store.size': None}
Codecov Report
@@ Coverage Diff @@
## master #91 +/- ##
==========================================
- Coverage 94.40% 94.12% -0.29%
==========================================
Files 15 15
Lines 966 970 +4
==========================================
+ Hits 912 913 +1
- Misses 54 57 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hi @james-stead, Thank you for your contribution, looks good to me. Can you please update your branch with the current master. I've just merged a PR that will fix CI lint step. More completeness and stability would be super great if you could add a test to verify that an index without a count will behave has expected |
if int(item["docs.count"]) == 0: | ||
is_empty = True | ||
break | ||
except Exception as ex: |
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.
too broad exception, replace it by TypeError
. Also it seems less clear what can be expected from the ES index.
what do you think about:
if item["docs.count"] is None or item["docs.count"] in (0, "0")
Our Elastic cluster has a number of indexes that don't return this value. The indexes do appear to be empty as well from looking at the indexes in elastic. This is the for example is what is in item:
{'health': 'green', 'status': 'open', 'index': '', 'uuid': 't_w0eDA9SXS8CGYhYtXhfg', 'pri': '1', 'rep': '1', 'docs.count': None, 'docs.deleted': None, 'store.size': None, 'pri.store.size': None}