MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / execute

Method execute

lib/sqlalchemy/orm/unitofwork.py:440–465  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

438 }.difference(cycles)
439
440 def execute(self) -> None:
441 postsort_actions = self._generate_actions()
442
443 postsort_actions = sorted(
444 postsort_actions,
445 key=lambda item: item.sort_key,
446 )
447 # sort = topological.sort(self.dependencies, postsort_actions)
448 # print "--------------"
449 # print "\ndependencies:", self.dependencies
450 # print "\ncycles:", self.cycles
451 # print "\nsort:", list(sort)
452 # print "\nCOUNT OF POSTSORT ACTIONS", len(postsort_actions)
453
454 # execute
455 if self.cycles:
456 for subset in topological.sort_as_subsets(
457 self.dependencies, postsort_actions
458 ):
459 set_ = set(subset)
460 while set_:
461 n = set_.pop()
462 n.execute_aggregate(self, set_)
463 else:
464 for rec in topological.sort(self.dependencies, postsort_actions):
465 rec.execute(self)
466
467 def finalize_flush_changes(self) -> None:
468 """Mark processed objects as clean / deleted after a successful

Callers 1

_flushMethod · 0.95

Calls 5

_generate_actionsMethod · 0.95
popMethod · 0.45
execute_aggregateMethod · 0.45
sortMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected