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

fix(shared-data): Fix migrating mutable pipette configs #16962

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def _do_edit_non_quirk(
elif thiskey == "##EACHTIPTYPE##":
for key in existing.keys():
_do_edit_non_quirk(new_value, existing[key], restkeys)
elif thiskey == "##EACHTIP##":
for key in existing.keys():
_do_edit_non_quirk(new_value, existing[key], restkeys)
Comment on lines +61 to +63
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this other function need the same change?

def _edit_non_quirk_with_lc_override(
mutable_config_key: str,
new_mutable_value: Any,
base_dict: Dict[str, Any],
liquid_class: Optional[LiquidClasses],
) -> None:
def _do_edit_non_quirk(
new_value: Any, existing: Dict[Any, Any], keypath: List[Any]
) -> None:
thiskey: Any = keypath[0]
if thiskey in [lc.name for lc in LiquidClasses]:
if liquid_class:
thiskey = liquid_class
else:
thiskey = LiquidClasses[thiskey]
if len(keypath) > 1:
restkeys = keypath[1:]
if thiskey == "##EACHTIP##":
for key in existing.keys():
_do_edit_non_quirk(new_value, existing[key], restkeys)
else:
_do_edit_non_quirk(new_value, existing[thiskey], restkeys)
else:
# This was the last key
if thiskey == "##EACHTIP##":
for key in existing.keys():
existing[key] = new_value
else:
existing[thiskey] = new_value
new_names = _MAP_KEY_TO_V2[mutable_config_key]
_do_edit_non_quirk(new_mutable_value, base_dict, new_names)

else:
_do_edit_non_quirk(new_value, existing[thiskey], restkeys)
else:
Expand Down
Loading