summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-05-23 18:01:07 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-05-24 18:48:01 -0400
commitf146f19d4bf1f9150785e22d37a62dcbe3436c9a (patch)
tree756225b1cac5d3c4f6760014c6972199f267ec2a /lib/sqlalchemy/orm/mapper.py
parent90882ed43cce26c069b6696b441b6ad8a7372301 (diff)
downloadsqlalchemy-f146f19d4bf1f9150785e22d37a62dcbe3436c9a.tar.gz
Unify NO_VALUE and NEVER_SET
There's no real difference between these two constants except they are used in different places and therefore allow various codepaths to work largely by accident. These codepaths should be explicit. Assign NO_VALUE and NEVER_SET to the same constant and work towards having just one constant for "we have no value to return right now". Fixes: #4696 Change-Id: I7c324967952c1886bf202074d627323a2ad013cc
Diffstat (limited to 'lib/sqlalchemy/orm/mapper.py')
-rw-r--r--lib/sqlalchemy/orm/mapper.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index ccf05a783..3c26f7247 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -2715,7 +2715,7 @@ class Mapper(InspectionAttr):
return self._identity_key_from_state(state, attributes.PASSIVE_OFF)
def _identity_key_from_state(
- self, state, passive=attributes.PASSIVE_RETURN_NEVER_SET
+ self, state, passive=attributes.PASSIVE_RETURN_NO_VALUE
):
dict_ = state.dict
manager = state.manager
@@ -2769,7 +2769,7 @@ class Mapper(InspectionAttr):
return {prop.key for prop in self._all_pk_props}
def _get_state_attr_by_column(
- self, state, dict_, column, passive=attributes.PASSIVE_RETURN_NEVER_SET
+ self, state, dict_, column, passive=attributes.PASSIVE_RETURN_NO_VALUE
):
prop = self._columntoproperty[column]
return state.manager[prop.key].impl.get(state, dict_, passive=passive)
@@ -2790,7 +2790,7 @@ class Mapper(InspectionAttr):
)
def _get_committed_state_attr_by_column(
- self, state, dict_, column, passive=attributes.PASSIVE_RETURN_NEVER_SET
+ self, state, dict_, column, passive=attributes.PASSIVE_RETURN_NO_VALUE
):
prop = self._columntoproperty[column]