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

Method create_row_processor

lib/sqlalchemy/orm/strategies.py:1963–2067  ·  view source on GitHub ↗
(
        self,
        context,
        query_entity,
        path,
        loadopt,
        mapper,
        result,
        adapter,
        populators,
    )

Source from the content-addressed store, hash-verified

1961 return q
1962
1963 def create_row_processor(
1964 self,
1965 context,
1966 query_entity,
1967 path,
1968 loadopt,
1969 mapper,
1970 result,
1971 adapter,
1972 populators,
1973 ):
1974 if (
1975 loadopt
1976 and context.compile_state.statement is not None
1977 and context.compile_state.statement.is_dml
1978 ):
1979 util.warn_deprecated(
1980 "The subqueryload loader option is not compatible with DML "
1981 "statements such as INSERT, UPDATE. Only SELECT may be used."
1982 "This warning will become an exception in a future release.",
1983 "2.0",
1984 )
1985
1986 if context.refresh_state:
1987 return self._immediateload_create_row_processor(
1988 context,
1989 query_entity,
1990 path,
1991 loadopt,
1992 mapper,
1993 result,
1994 adapter,
1995 populators,
1996 )
1997
1998 _, run_loader, _, _ = self._setup_for_recursion(
1999 context, path, loadopt, self.join_depth
2000 )
2001 if not run_loader:
2002 return
2003
2004 if not isinstance(context.compile_state, ORMSelectCompileState):
2005 # issue 7505 - subqueryload() in 1.3 and previous would silently
2006 # degrade for from_statement() without warning. this behavior
2007 # is restored here
2008 return
2009
2010 if not self.parent.class_manager[self.key].impl.supports_population:
2011 raise sa_exc.InvalidRequestError(
2012 "'%s' does not support object "
2013 "population - eager loading cannot be applied." % self
2014 )
2015
2016 # a little dance here as the "path" is still something that only
2017 # semi-tracks the exact series of things we are loading, still not
2018 # telling us about with_polymorphic() and stuff like that when it's at
2019 # the root.. the initial MapperEntity is more accurate for this case.
2020 if len(path) == 1:

Callers

nothing calls this directly

Calls 8

_create_scalar_loaderMethod · 0.95
_setup_for_recursionMethod · 0.80
isaMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected