uranusjr commented on code in PR #39075:
URL: https://github.com/apache/airflow/pull/39075#discussion_r1571673393
##########
airflow/www/views.py:
##########
@@ -4589,7 +4591,10 @@ def varimport(self, session):
skipped.add(k)
continue
try:
- models.Variable.set(k, v, serialize_json=not isinstance(v,
str))
+ if isinstance(v,dict) and "description" in v and "val" in
v:
+ models.Variable.set(k, v["val"],
description=v["description"], serialize_json=not isinstance(v["val"], str))
+ else:
+ models.Variable.set(k, v, serialize_json=not
isinstance(v, str))
Review Comment:
Instead of needing this if-else, it’s probably better to always make `v` a
dict instead.
--
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]