theobjectivedad commented on issue #33036:
URL: https://github.com/apache/airflow/issues/33036#issuecomment-1663067762

   Good evening @jens-scheffler-bosch , I’ve been running a custom version of 
the DockerOperator for several weeks and would like to back-port.
   
   To your point, I can imagine a scenario where folks may not want all dag 
params exposed as environment variables. Also, great feedback RE non-string 
values - I didn’t consider this.
   
   I feel like adding another optional constructor parameter that contained a 
list of dag params that would be excluded from the container environment and 
wrapping the remaining dag params in a str() it would provide sufficient 
flexibility. 
   
   To recap the design:
   
   * pass_params_to_env is added to the DockerOperator constructor and when 
True would enable the feature. It will default to False to maintain 
compatibility. I’ll document that values will be converted to strings to make 
it clear for other DAG developers 
   * Another optional parameter exclude_params_in_env will be an optional list 
of DAG parameter names that will not be passed to the container environment 
   
   I was thinking about adding an include_params_in_env as well but I think 
when we are starting to list parameters it would just be better to map them in 
the environment template. 
   
   Thank you again for your good feedback, let me know if this seems reasonable!
   
   


-- 
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]

Reply via email to