diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2020-03-10 21:26:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-03-10 21:26:37 +0000 |
commit | 99864e0c2e3ccb0de22e74312f97e97b1495747c (patch) | |
tree | 10350f1e78f34da518c607099e536d4341fa6353 /lib/sqlalchemy/sql/compiler.py | |
parent | 71e368081a63b323bea092b379523d8cd0ab3fdb (diff) | |
parent | eda6dbbf387def2063d1b6719b64b20f9e7f2ab4 (diff) | |
download | sqlalchemy-99864e0c2e3ccb0de22e74312f97e97b1495747c.tar.gz |
Merge "Simplified module pre-loading strategy and made it linter friendly"
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 3ebcf24b0..b37c46216 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1022,9 +1022,10 @@ class SQLCompiler(Compiled): return expanded_state - @util.dependencies("sqlalchemy.engine.result") - def _create_result_map(self, result): + @util.preload_module("sqlalchemy.engine.result") + def _create_result_map(self): """utility method used for unit tests only.""" + result = util.preloaded.engine_result return result.CursorResultMetaData._create_description_match_map( self._result_columns ) @@ -4127,8 +4128,10 @@ class IdentifierPreparer(object): ident = self.quote_identifier(ident) return ident - @util.dependencies("sqlalchemy.sql.naming") - def format_constraint(self, naming, constraint, _alembic_quote=True): + @util.preload_module("sqlalchemy.sql.naming") + def format_constraint(self, constraint, _alembic_quote=True): + naming = util.preloaded.sql_naming + if isinstance(constraint.name, elements._defer_name): name = naming._constraint_name_for_table( constraint, constraint.table |