You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/08/09 05:37:13 UTC
[GitHub] [superset] EugeneTorap commented on a diff in pull request #21002: chore: Support Python 3.10 and bump pandas 1.4 and pyarrow 6
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.

--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org