dstandish commented on a change in pull request #19505:
URL: https://github.com/apache/airflow/pull/19505#discussion_r757135654
##########
File path: airflow/models/xcom.py
##########
@@ -364,6 +372,12 @@ def orm_deserialize_value(self) -> Any:
return BaseXCom.deserialize_value(self)
+def serialize_value_shim(**kwargs):
+ signature = inspect_function_arguments(XCom.serialize_value)
+ kwargs = {k: v for k, v in kwargs.items() if k in
signature.bound_arguments}
+ return XCom.serialize_value(**kwargs)
Review comment:
yeah totally, and truthfully i intended to add a docstring there but was
just taking a couple minutes to refactor last night... probably should have
been marked as a draft... i think flake8 fails when you omit docstring too but
i disable locally sometimes when i don't want docker running... i just meant
to indicate "yup i have some explanation ready to go"
anyway docstring is there now. i tweaked the approach slightly to iterate
over `bound_arguments` instead of keys ... seems a little cleaner this way.
one potential optimization is we could sort of "cache" the signature
inspection so we don't have to do it every call. or even cache the shim
function so it doesn't have to do any logic... but both operations are cheap
and probably it's not worth the clutter.
lmkt
thanks
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]