-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
(filter) expected one of [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has, within], "match" found"
#555
Comments
Update: When I change my test case like this
I thing there are two things missing here …
However, both does not explain, why the test fails when using |
I haven't looked deeply into this, but the filter logic is complicated, especially with old and new syntax that do not work well together. This might be the case here, I'm not sure... |
@HarelM which part is old and which is new here? The error shows with both the Also, is there a helper to transform old to new? I might be able to work around the whole some issues by updating the filter expressions on the fly before applying them… |
This library has a tool to migrate a style, it might not be the case in for this issue, but it's worth I shot I guess... |
@tordans is this still relevant? |
Yes, very much. I am getting those warning everywhere and I was not able to get any hints in OsmUS Slack or offline conversations on why they are happening or how to get rid of them. I still think there is a bug that should treat The details in my initial ticket on how to reproduce on the website and in the test are still valid. |
I think the problem is with the first comparison, as this is using old syntax, I think. The "new" syntax will need to use I hope this helps. |
Don't you have to do |
Thanks @HarelM that does work. I am still having issues with the example app above but after testing the same conditions in a simplified environment visgl/react-map-gl#2386 there where no issues. I have no idea why those errors show up :-/. One thing that would be ideal for the docs like https://maplibre.org/maplibre-style-spec/expressions/#_1 where to be more explicit in the examples about how to use the second array value. Would that be something that can be merged @HarelM and if so, where does this part of the docs live? Current: For example like this: Initial
+ },
+ ValidationError {
+ "line": 166,
+ "message": "layers[16].filter[2][0]: expected one of [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has, within], \"match\" found",
}, Adding one
|
The examples for the expressions exist in the v8.json file in this repo. |
Describe the bug
I am getting console error messages about filters which do work but still produce an error. I don't understand why they would be wrong or how to change them to prevent the error. I am merging filters in React (using react-map-gl) and only really have control over some of the filters but the external filters.
I can reproduce the error when adding a filter to the integration tests.
To Reproduce online
Steps to reproduce the behavior:
Error: layers.lane markings dashed.filter[2][0]: expected one of [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has, within], "match" found
To Reproduce in tests
test/integration/style-spec/tests/filters.input.json
npm run test-integration
Expected behavior
I expect
match
filters to be valid filters the same as==
Additional context
I was wondering it the issue is, that
match
has a return type ofOutputType
according to https://maplibre.org/maplibre-style-spec/expressions/#match whereas other listed "allowed" filter returnboolean
(egin
https://maplibre.org/maplibre-style-spec/expressions/#in) andall
expectboolean
https://maplibre.org/maplibre-style-spec/expressions/#allThe text was updated successfully, but these errors were encountered: