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

check for schema equivalence by sorting keys in both schemas #22

Open
codekiln opened this issue Aug 11, 2018 · 1 comment
Open

check for schema equivalence by sorting keys in both schemas #22

codekiln opened this issue Aug 11, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@codekiln
Copy link
Contributor

codekiln commented Aug 11, 2018

In 0.7.1 we shifted from raising an error to logging a warning when the schema in the codebase did not match the one requested from the database. This is a good start, but the hash_equals method could be more forgiving; if the hashes don't match, it should load them as dictionaries and check for equivalence, since order doesn't matter in elasticsearch schemas.

@codekiln codekiln added the bug Something isn't working label Aug 11, 2018
@codekiln codekiln self-assigned this Aug 11, 2018
@codekiln
Copy link
Contributor Author

Ran into this today, just a reminder, the easiest way to see if the schema has actually changed when the json_md5 differs for index my_index_name is:

>>> json.loads(DEMIndexManager.get_active_index_version('my_index_name').json) == json.loads(DEMIndexManager.get_dem_index('my_index_name').get_index_hash_and_json()[1])

If the result is True, then the schemas have not changed (even if their json hash differs because of key sorting). If the result if False, then the schemas have changed.

@codekiln codekiln removed their assignment Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant