Skip to content

Commit 462f4b3

Browse files
committed
removing duplicates from 'in' condition
1 parent 66ab47f commit 462f4b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/sqlalchemy_bulk_lazy_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ def _emit_lazyload(self, session, state, ident_key, passive):
178178
# Find all models in this session that also need this same relationship to be populated
179179
similar_models = self._get_similar_unpopulated_models(current_model, session)
180180
param_value_to_models = {}
181-
param_values = []
181+
param_values = set()
182182
for model in similar_models:
183183
value = self._get_model_value(model, col=self._ident, mapper=parent_mapper, passive=passive)
184184
param_value_to_models[value] = param_value_to_models.get(value, [])
185185
param_value_to_models[value].append(model)
186-
param_values.append(value)
186+
param_values.add(value)
187187

188188
if self.parent_property.secondary is not None:
189189
# if there's a secondary join, we want to just replace the first join clause in the filter

0 commit comments

Comments
 (0)