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
feat(config): load config with hybrid strategies #15447
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15447 +/- ##
==========================================
- Coverage 77.17% 77.02% -0.15%
==========================================
Files 974 978 +4
Lines 50698 50766 +68
Branches 6238 6238
==========================================
- Hits 39124 39102 -22
- Misses 11361 11451 +90
Partials 213 213
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
left_dict = take_conf_keys_and_convert_to_dict(left_value) | ||
right_dict = take_conf_keys_and_convert_to_dict(right_value) | ||
try: | ||
return merge_dicts_recursive(left_dict, right_dict) |
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.
how about this?
return merge_dicts_recursive(left_dict, right_dict) | |
return dict(**left_dict, **right_dict) |
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.
but it doesn't merge with recursive manner
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
SUMMARY
following the latest config loading mechanism changes and breaking changes and its follow-ups fixes:
#15448
#15444
#15435
we wanted to propose a new way for two configurations files (.py) to be unioned
and to allow flexibility to choose a strategy based on the value type
Assume config.py contains (left side)
KEY1 = { ... }
KEY2 = SomeClass
and superset_config.py contains (right side)
KEY1 = { ... }
KEY2 = SomeClass
There are 5 kinds of strategies how to union those KEY - Values
current meta configurations
meta_union_strategy = {
(type, type): override_right_as_class_strategy,
(type, dict): override_right_as_class_strategy,
(dict, type): override_right_as_class_strategy,
(dict, dict): merge_as_dict_strategy,
(Any, Any): take_right_strategy
}
this PR will in the future enables us to :
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
tests/initializations/configurations/meta_configurations_tests.py
ADDITIONAL INFORMATION