You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this library meant to do filtering like the YAML processor yq does ? If it does, I guess I would have to implement the filtering logic (see example below) but that would not be too complicated because of the provided parsing facilities. Speaking of facilities, do you have a function that checks if a YAML node is a subset of another node ?
# Filtering example using 'yq'# Filters out every data sequences that does not match:# query.scene == "box-1c" && # query.request == "First Contact"
yq 'del(.data[] | select((.query.scene == "box-1c" and .query.request == "First Contact")|not))'< dataset.yaml
YAML file:
data:
- query:
scene: box-1crequest: First Contact
- query:
scene: emptyrequest: All Contact
- query:
scene: emptyrequest: First Contact
- query:
scene: emptyrequest: First Contact
After filtering:
data:
- query:
scene: box-1crequest: First Contact
The text was updated successfully, but these errors were encountered:
Is this library meant to do filtering like the YAML processor yq does ?
No, filtering is not the intent, and is not contemplated. In terms of importance, modification and replacement of existing nodes is the first objective, adding nodes the second, and removal of nodes is possible but just as an artifact of the first two: assigning an empty node. Selective removal is not considered.
do you have a function that checks if a YAML node is a subset of another node ?
Is this library meant to do filtering like the YAML processor yq does ? If it does, I guess I would have to implement the filtering logic (see example below) but that would not be too complicated because of the provided parsing facilities. Speaking of facilities, do you have a function that checks if a YAML node is a subset of another node ?
YAML file:
After filtering:
The text was updated successfully, but these errors were encountered: