You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/27 05:21:55 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #25248: WIP: Serialized object property

uranusjr commented on code in PR #25248:
URL: https://github.com/apache/airflow/pull/25248#discussion_r930630835


##########
airflow/utils/helpers.py:
##########
@@ -376,3 +376,16 @@ def is_empty(x):
         return new_list
     else:
         return val
+
+
+def resolve_property_value(obj, prop):
+    """Return class property value.
+
+    :param obj: Reference to class.
+    :param prop: Reference to class property.
+    :returns: If ``prop`` property than return property value,
+        otherwise it returns class attribute value.
+    """
+    if isinstance(prop, property):
+        return prop.fget(obj)
+    return prop

Review Comment:
   This can live directly in `serialized_objects` instead (and be a private function)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org