Skip to content

Commit

Permalink
Allow disabling legacy sublattice path
Browse files Browse the repository at this point in the history
  • Loading branch information
cjao committed May 28, 2024
1 parent 8cf7858 commit f6b6ba9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions covalent/_workflow/electron.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. For now we require
# the executor to reach the Covalent server
Expand All @@ -895,5 +897,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()

0 comments on commit f6b6ba9

Please sign in to comment.