MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / execute

Method execute

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

Source from the content-addressed store, hash-verified

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