Skip to content

Commit 96a60fd

Browse files
authored
Fixes a circular import issue in excelimporter (#1209)
1 parent 7e132a4 commit 96a60fd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

activity_browser/bwutils/strategies.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
TECHNOSPHERE_TYPES = {"technosphere", "substitution", "production"}
2222
BIOSPHERE_TYPES = {"economic", "emission", "natural resource", "social"}
2323

24+
RELINK_FIELDS = ("name", "database", "categories", "unit", "reference product", "location")
25+
2426

2527
def relink_exchanges_dbs(data: Collection, relink: dict) -> Collection:
2628
"""Use this to relink exchanges during an actual import."""
@@ -62,7 +64,7 @@ def _relink_exchanges(data: list, other: str) -> list:
6264
act = other.random()
6365
is_technosphere = act.get("type", "process") == "process"
6466
kind = TECHNOSPHERE_TYPES if is_technosphere else BIOSPHERE_TYPES
65-
return link_iterable_by_fields(data, other=other, kind=kind)
67+
return link_iterable_by_fields(data, other=other, kind=kind, fields=RELINK_FIELDS, relink=True)
6668

6769

6870
def relink_exchanges_bw2package(data: dict, relink: dict) -> dict:

0 commit comments

Comments
 (0)