File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
providers/standard/src/airflow/providers/standard/operators Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -495,9 +495,21 @@ def get_python_source(self):
495
495
return textwrap .dedent (inspect .getsource (self .python_callable ))
496
496
497
497
def _write_args (self , file : Path ):
498
+ def resolve_proxies (obj ):
499
+ """Recursively replaces lazy_object_proxy.Proxy instances with their resolved values."""
500
+ if isinstance (obj , lazy_object_proxy .Proxy ):
501
+ return obj .__wrapped__ # force evaluation
502
+ if isinstance (obj , dict ):
503
+ return {k : resolve_proxies (v ) for k , v in obj .items ()}
504
+ if isinstance (obj , list ):
505
+ return [resolve_proxies (v ) for v in obj ]
506
+ return obj
507
+
498
508
if self .op_args or self .op_kwargs :
499
509
self .log .info ("Use %r as serializer." , self .serializer )
500
- file .write_bytes (self .pickling_library .dumps ({"args" : self .op_args , "kwargs" : self .op_kwargs }))
510
+ file .write_bytes (
511
+ self .pickling_library .dumps ({"args" : self .op_args , "kwargs" : resolve_proxies (self .op_kwargs )})
512
+ )
501
513
502
514
def _write_string_args (self , file : Path ):
503
515
file .write_text ("\n " .join (map (str , self .string_args )))
You can’t perform that action at this time.
0 commit comments