MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _set_chunksize

Method _set_chunksize

lib/sqlalchemy/orm/strategies.py:2984–2996  ·  view source on GitHub ↗
(cls, loadopt)

Source from the content-addressed store, hash-verified

2982
2983 @classmethod
2984 def _set_chunksize(cls, loadopt) -> int:
2985 if loadopt is None or hasattr(loadopt, "local_opts") is None:
2986 return cls._chunksize
2987
2988 user_input = loadopt.local_opts.get("chunksize", None)
2989 if user_input is None:
2990 return cls._chunksize
2991 elif not isinstance(user_input, int) or user_input < 1:
2992 raise sa_exc.ArgumentError(
2993 f"'chunksize={user_input}' is not an appropriate input, "
2994 f"please use a positive non-zero integer."
2995 )
2996 return user_input
2997
2998 def __init__(self, parent, strategy_key):
2999 super().__init__(parent, strategy_key)

Callers 1

_load_for_pathMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected