text: Title: refactor DAG partial build to use shallow copy
  Body: `dag.build_partially` uses `deepcopy` internally, however, the DAG may contain references to unserializable objects (this may happen with database clients). I think it's safe to do a shallow copy, so we need to test it and if it's the case, switch the deep copy