Browse Source

[hbase] Fix module has no attribute from io.StringIO when there is no avro module loaded (#3006)

Internal Jira: CDPD-44973

Co-authored-by: Harsh Gupta <42064744+Harshg999@users.noreply.github.com>
Mahesh Balakrishnan 3 years ago
parent
commit
ef515e5f50
1 changed files with 4 additions and 1 deletions
  1. 4 1
      apps/hbase/src/hbase/views.py

+ 4 - 1
apps/hbase/src/hbase/views.py

@@ -101,7 +101,10 @@ def api_dump(response):
         #detect if avro file
         if(data[:3] == '\x4F\x62\x6A'):
           #write data to file in memory
-          output = io.StringIO()
+          try:
+            output = io.StringIO()
+          except:
+            output = string_io()
           output.write(data)
 
           #read and parse avro