From 08158db23c9f984dc7f55c6d65fcd04126d77915 Mon Sep 17 00:00:00 2001 From: Casey Jao Date: Sun, 26 May 2024 20:47:00 -0400 Subject: [PATCH] Allow disabling legacy sublattice path --- covalent/_workflow/electron.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/covalent/_workflow/electron.py b/covalent/_workflow/electron.py index 33cf27dbd..3c31f4b09 100644 --- a/covalent/_workflow/electron.py +++ b/covalent/_workflow/electron.py @@ -872,6 +872,8 @@ def _build_sublattice_graph(sub: Lattice, json_parent_metadata: str, *args, **kw sub.build_graph(*args, **kwargs) + DISABLE_LEGACY_SUBLATTICES = os.environ.get("COVALENT_DISABLE_LEGACY_SUBLATTICES") == "1" + try: # Attempt multistage sublattice dispatch. @@ -899,5 +901,7 @@ def _build_sublattice_graph(sub: Lattice, json_parent_metadata: str, *args, **kw except Exception as ex: # Fall back to legacy sublattice handling + if DISABLE_LEGACY_SUBLATTICES: + raise print("Falling back to legacy sublattice handling") return sub.serialize_to_json()