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

FIX: missing keys should not cause failure in backend #234

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

klauer
Copy link
Contributor

@klauer klauer commented Mar 4, 2022

Description

Missing keys should not cause a find match to fail.

Motivation and Context

Investigating xcs long load times

2022-03-03 16:44:27 - PID 7917         json_db.py: 149 _iterative_compare DEBUG    - Comparison method failed: 'lightpath'
Traceback (most recent call last):
  File "/u1/xcsopr/conda_envs/pcds-5.2.1/lib/python3.9/site-packages/happi/backends/json_db.py", line 146, in _iterative_compare
    if comparison(name, doc):
  File "/u1/xcsopr/conda_envs/pcds-5.2.1/lib/python3.9/site-packages/happi/backends/json_db.py", line 190, in comparison
    if all(value == doc[k] for k, value in to_match.items()):
  File "/u1/xcsopr/conda_envs/pcds-5.2.1/lib/python3.9/site-packages/happi/backends/json_db.py", line 190, in <genexpr>
    if all(value == doc[k] for k, value in to_match.items()):
KeyError: 'lightpath'

@klauer klauer requested review from ZLLentz and tangkong March 4, 2022 01:01
Copy link
Contributor

@tangkong tangkong left a comment

Choose a reason for hiding this comment

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

This all looks good to me, though it doesn't seem to help my load times. I'm getting significantly longer load times than the scientists mentioned (~1.5 min), so I should look into that.

These changes are still good though

@klauer
Copy link
Contributor Author

klauer commented Mar 4, 2022

Yeah, @tangkong, this was more "unnecessary log spam" than anything.
I'm relatively certain that speed issue is due to the reasons listed in #235 - I think it'd be good to come up with a consensus on what's an acceptable solution there.

@klauer klauer merged commit e3f92f2 into pcdshub:master Mar 4, 2022
@klauer klauer deleted the fix_match_missing_key branch March 4, 2022 17:03
@ZLLentz
Copy link
Member

ZLLentz commented Mar 8, 2022

Retroactive LGTM

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