Pārlūkot izejas kodu

HUE-4860 [editor] Exporting saved query result without a name should use query name

Romain Rigaux 9 gadi atpakaļ
vecāks
revīzija
9b3062d

+ 4 - 1
desktop/libs/notebook/src/notebook/api.py

@@ -668,7 +668,10 @@ def export_result(request):
 
   if data_format == 'hdfs-file':
     if request.fs.isdir(destination):
-      destination += '/%(type)s-%(id)s.csv' % notebook
+      if notebook.get('name'):
+        destination += '/%(name)s.csv' % notebook
+      else:
+        destination += '/%(type)s-%(id)s.csv' % notebook
     if overwrite and request.fs.exists(destination):
       request.fs.do_as_user(request.user.username, request.fs.rmtree, destination)
     response['watch_url'] = api.export_data_as_hdfs_file(snippet, destination, overwrite)

+ 2 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1548,7 +1548,8 @@
          parentSavedQueryUuid: self.parentSavedQueryUuid,
          isSaved: self.isSaved,
          sessions: self.sessions,
-         type: self.type
+         type: self.type,
+         name: self.name
       };
     };