EugeneTorap commented on code in PR #21002:
URL: https://github.com/apache/superset/pull/21002#discussion_r940915810


##########
superset/examples/bart_lines.py:
##########
@@ -34,7 +34,7 @@ def load_bart_lines(only_metadata: bool = False, force: bool 
= False) -> None:
     table_exists = database.has_table_by_name(tbl_name)
 
     if not only_metadata and (not table_exists or force):
-        content = get_example_data("bart-lines.json.gz")
+        content = get_example_data("bart-lines.json.gz", make_bytes=True)

Review Comment:
   @betodealmeida Because `get_example_data` returns `bytes` and pandas 
version(1.4.0) resulting TypeError, `make_bytes=True` make `content = 
BytesIO(content)` 
   We can also use `StringIO` for it.
   And without it we got such error:
   
   > File "/home/runner/work/superset/superset/superset/cli/examples.py", line 
113, in load_examples
       load_examples_run(load_test_data, load_big_data, only_metadata, force)
     File "/home/runner/work/superset/superset/superset/cli/examples.py", line 
49, in load_examples_run
       examples.load_world_bank_health_n_pop(only_metadata, force)
     File 
"/home/runner/work/superset/superset/superset/examples/world_bank.py", line 
[60](https://github.com/apache/superset/runs/7710893773?check_suite_focus=true#step:8:61),
 in load_world_bank_health_n_pop
       pdf = pd.read_json(data)
   TypeError: Expected file path name or file-like object, got <class 'bytes'> 
type
   Error: Process completed with exit code 1.
   
   
![image](https://user-images.githubusercontent.com/29536522/183571826-c7e85066-3b2d-4de7-b8d9-521b5f774af7.png)
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to