فهرست منبع

HUE-8370 [pig] Imported old version Pig script missing properties fields

Ying Chen 7 سال پیش
والد
کامیت
134febcd54
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      desktop/core/src/desktop/api2.py

+ 8 - 0
desktop/core/src/desktop/api2.py

@@ -223,6 +223,14 @@ def _get_document_helper(request, uuid, with_data, with_dependencies, path):
       notebook = Notebook(document=document)
       notebook = upgrade_session_properties(request, notebook)
       data = json.loads(notebook.data)
+      if document.type == 'query-pig': # Import correctly from before Hue 4.0
+        properties = data['snippets'][0]['properties']
+        if 'hadoopProperties' not in properties:
+          properties['hadoopProperties'] = []
+        if 'parameters' not in properties:
+          properties['parameters'] = []
+        if 'resources' not in properties:
+          properties['resources'] = []
       if data.get('uuid') != document.uuid: # Old format < 3.11
         data['uuid'] = document.uuid