diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2020-11-17 21:44:01 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-11-17 21:44:01 +0000 |
| commit | cef2871ef99af3cc6a40d98a2651c6dad7542d75 (patch) | |
| tree | 3cca70d6ee9e259b50db86b910e398c730167df0 | |
| parent | 7082e4c447c664af43a6576f5749c97a9951d7dd (diff) | |
| parent | 5e88129d87fbe833dd1b88a48a0b7e281236836a (diff) | |
| download | sqlalchemy-cef2871ef99af3cc6a40d98a2651c6dad7542d75.tar.gz | |
Merge "Data type is supported only on sequences, not indentity"
| -rw-r--r-- | lib/sqlalchemy/sql/schema.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 98ea8648a..c1f7ab58a 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -2408,7 +2408,6 @@ class IdentityOptions(object): cycle=None, cache=None, order=None, - data_type=None, ): """Construct a :class:`.IdentityOptions` object. @@ -2427,7 +2426,6 @@ class IdentityOptions(object): sequence which are calculated in advance. :param order: optional boolean value; if ``True``, renders the ORDER keyword. - :param data_type: The type to be returned by the sequence. """ self.start = start @@ -2439,10 +2437,6 @@ class IdentityOptions(object): self.cycle = cycle self.cache = cache self.order = order - if data_type is not None: - self.data_type = to_instance(data_type) - else: - self.data_type = None class Sequence(IdentityOptions, roles.StatementRole, DefaultGenerator): @@ -2652,7 +2646,6 @@ class Sequence(IdentityOptions, roles.StatementRole, DefaultGenerator): cycle=cycle, cache=cache, order=order, - data_type=data_type, ) self.name = quoted_name(name, quote) self.optional = optional @@ -2666,6 +2659,10 @@ class Sequence(IdentityOptions, roles.StatementRole, DefaultGenerator): self._key = _get_table_key(name, schema) if metadata: self._set_metadata(metadata) + if data_type is not None: + self.data_type = to_instance(data_type) + else: + self.data_type = None @util.memoized_property def is_callable(self): |
