-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add zip_lists filter to yacfg | Improve and cleanup the github actions #316
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,11 @@ def override_value_map_keys(value: Dict[str, Any]) -> Dict[str, Any]: | |
""" | ||
return {override_value(key, key): val for key, val in value.items()} | ||
|
||
def zip_lists(value: List[Any], pairing: List[Any]) -> List[(Any, Any)]: | ||
if not isinstance(value, List) or not isinstance(pairing, List): | ||
return [] | ||
return zip(value, pairing) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to have a test/usage example for this. Having the actual template this will operate on only in a separate repo sucks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree and will try to add the test into profile_test.sh. |
||
|
||
# Pass empty filter for performance if extra_properties_data is not defined (no more conditions) | ||
env.filters["overridevalue"] = ( | ||
override_value if extra_properties_data else empty_filter | ||
|
@@ -144,6 +149,8 @@ def override_value_map_keys(value: Dict[str, Any]) -> Dict[str, Any]: | |
override_value_list_map_keys if extra_properties_data else empty_filter | ||
) | ||
|
||
env.filters["zip_lists"] = zip_lists | ||
|
||
template_list = get_main_template_list(env) | ||
if output_filter: | ||
template_list = filter_template_list(template_list, output_filter) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the invalid syntax for tuple types we discussed last week?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. It currently runs for me. Will check to make sure and resolve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.