+1 Extra is required to be a JSON when connections are via in the UI now (a big hairy error message is displayed if it isn't) so hopefully that reduces blast radius for existing connections a bit.
On Fri, Feb 25, 2022 at 7:41 AM Kaxil Naik <[email protected]> wrote: > +1 > > On Fri, 25 Feb 2022 at 12:35, Tomasz Urbaszek <[email protected]> wrote: > >> +1 for this idea. >> >> Should we provide some way of validating existing connections so users >> can check this before upgrading to 3.0? >> >> Thanks, >> Tomek >> >> On Fri, 25 Feb 2022 at 10:14, Ash Berlin-Taylor <[email protected]> wrote: >> >>> I'm all for this. >>> >>> What does this mean for the extra and extra_dejson attrs that exist on >>> Connection right now? >>> >>> -a >>> >>> On Thu, Feb 24 2022 at 23:23:20 -0800, Daniel Standish >>> <[email protected]> wrote: >>> >>> It's generally assumed that the `extra` field in airflow's Connection >>> model is JSON string. However, it's not, strictly speaking, *required* >>> to be so. >>> >>> I believe we should require it to be JSON. >>> >>> But I also think we should nudge this a tiny bit further. A python >>> string value such as '"hi"' contains a valid json string "hi". And >>> similarly the string '[0,2,3]' is _also_ a valid string. But this is not >>> at all what is intended for `extra` and, I think for pretty obvious >>> reasons, a bad idea. So I think we should _also_ require that the value >>> for `extra`, if provided, must be json that parses as a python _dict_. >>> >>> So, to summarize, the proposal is, from release 3.0, require that conn >>> `extra` be json (or None) and require that the json (if provided) must >>> parse as a dict. >>> >>> PR to implement deprecation as prescribed by the proposal is here >>> <https://github.com/apache/airflow/pull/21816>. >>> >>> This vote will run until Tuesday at 8am UTC (three full weekdays). >>> >>> Thanks for your consideration. >>> >>>
