dstandish edited a comment on pull request #15013: URL: https://github.com/apache/airflow/pull/15013#issuecomment-810562815
I was inspired by this conversation to make a PR that adds support for arbitrary json in conn uri format: https://github.com/apache/airflow/pull/15100. We could also add support of the case of an unquoted arbitrary string value by modifying extra_dejson to return the string rather than empty dict in this case (see note at end of the PR description). It's orthogonal to this PR but obviously a closely related topic. > Is there a good reason why extra must be encoded JSON? Seems like a nice solution would be to allow for any string there. I think that the reason is to provide a reliable interface so that you know that extra params are accessible in a dictionary at property `extra_dejson`. > However, AFAICT, the constructor will not check this, and will not fail when extra is not JSON. But get_uri does check this (implicitly, by trying to decode then urlencode), and so we have the very weird case in which we can construct a Connection object for which get_uri fails, as @davlum has shown. I'd say that's fairly counterintuitive and surprising. Yeah probably it makes sense to enforce that `extra` is json in init but this would be breaking. I'll think about supporting the arbitrary and non-json-encoded string in #15100 -- 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. For queries about this service, please contact Infrastructure at: [email protected]
