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

Testing feature properties against field definitions #152

Merged
merged 4 commits into from
Dec 17, 2019

Conversation

jsanz
Copy link
Member

@jsanz jsanz commented Dec 12, 2019

fixes #151

Improving the test to check for every feature that all its properties are included in the source field definition. I also included a script I had on hold since it proved useful to fix the failing tests raised by this improvement.

With this new check I fixed also:

  • a very small (weird) single feature in Latvia that had an nuts prop inside
  • India and UK data had IDs inside the properties
  • South Korea and USA field mappings were incomplete

@jsanz jsanz requested a review from nickpeihl December 12, 2019 12:25
@jsanz jsanz self-assigned this Dec 12, 2019
@jsanz
Copy link
Member Author

jsanz commented Dec 12, 2019

@nickpeihl I did this change against feature-layers because it involved also fixing data.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

@jsanz
Copy link
Member Author

jsanz commented Dec 12, 2019

@nickpeihl I can also address #53 easily changing the test to make properties keys and field names fully equal but then we have three cases where some labels are not present as they were marked as optional in the SPARQL queries. The countries are

  • Montenegro
  • Peru
  • Slovenia

We can remove those labels, or maybe add a fallback value in the queries, just ignore those fields in the test, or skip this requirement. My initial thought is that since they were marked as OPTIONAL in the queries we should not enforce them subsequently but still check the rest of the fields to ensure our identifiers and other useful information are present in all the features.

Maybe we can add a new property for the field definition that marks it as optional, so the test can take it into account, but also any EMS client in the future?

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

Thanks @jsanz. I can not decide if we should do this or not. It does make the vector files more consistent, but I do not know if it is worth the changes we have to make to the existing data.

I would appreciate any additional thoughts you have.

sources/kr/south-korea-municipalities.hjson Outdated Show resolved Hide resolved
sources/us/states.hjson Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

@jsanz
Copy link
Member Author

jsanz commented Dec 16, 2019

Thanks @jsanz. I can not decide if we should do this or not. It does make the vector files more consistent, but I do not know if it is worth the changes we have to make to the existing data.

I would appreciate any additional thoughts you have.

I don't like much adding more complexity to the schema, since there are no external requirements for this. Still, I like having the chance to check this, so my last commit added the check only when an environment variable is present. That way the default behavior/contract is to check one way but still the way back can be also tested without breaking current CI, at least for the moment.

Since it's a very trivial change I can revert this one if we agree in a different approach independently of the changes in the data around that commit 😅.

I will also remove the property from South Korea and the US changes you suggested. Thanks for taking a look!!

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Copy link
Member

@nickpeihl nickpeihl 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.

@jsanz jsanz merged commit 887a89d into elastic:feature-layers Dec 17, 2019
@jsanz jsanz deleted the 151-test-props branch December 17, 2019 12:24
@nickpeihl nickpeihl mentioned this pull request Oct 20, 2021
5 tasks
nickpeihl added a commit to nickpeihl/ems-file-service that referenced this pull request Oct 20, 2021
In elastic#152 we changed the `name` field to `label_en` in the USA States layer in EMS 8+ to match the precedent with other country subdivisions. To make this change transparent to users, we need to have a saved object migration for term joins, styles, and tooltips that use the `name` field.

This PR proposes we delay the changes to the USA States layer to give us more time to implement the saved object migration in Kibana. With a proper migration it should be possible to implement this layer change in a minor EMS release (e.g. 8.1).  In that case we could change the `versions` in the `states_v1.hjson` and `states_v8.hjson` configs to be `1 - 8.0` and `>= 8.1` respectively.
nickpeihl added a commit that referenced this pull request Oct 21, 2021
In #152 we changed the `name` field to `label_en` in the USA States layer in EMS 8+ to match the precedent with other country subdivisions. To make this change transparent to users, we need to have a saved object migration for term joins, styles, and tooltips that use the `name` field.

This PR proposes we delay the changes to the USA States layer to give us more time to implement the saved object migration in Kibana. With a proper migration it should be possible to implement this layer change in a minor EMS release (e.g. 8.1).  In that case we could change the `versions` in the `states_v1.hjson` and `states_v8.hjson` configs to be `1 - 8.0` and `>= 8.1` respectively.
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