jscheffl commented on PR #59876: URL: https://github.com/apache/airflow/pull/59876#issuecomment-3698847884
> and every call site becomes verbose: > > Before: > > ```python > SUPERVISOR_COMMS.send(msg) > ``` > > After (unnecessary function call) > > ```python > supervisor_comms().send(msg) > ``` > > Every access now requires a function call + None check instead of direct variable access. @kaxil @amoghrajesh fair points and I am also not 100% convinced the solution is perfect. Te usage of the `SUPERVISOR_COMMS` seems still to be a case where we mess a lot with a global variable and encapsulating the state is still beneficial. Had another sleep about this and understand that `supervisor_comms().send()` is also not cool, how about if we cnage it to: ```python supervisor_send(data) ``` ...as a shortcut? Would it make it better to handle the sending in the function and have better readable code w/o global? -- 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]
