Skip to content

Commit

Permalink
Backport Test Only from PR #34500 on branch 1.0.x (REG: Fix read_parq…
Browse files Browse the repository at this point in the history
…uet from file-like objects) (#34787)

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Co-authored-by: alimcmaster1 <alimcmaster1@gmail.com>
  • Loading branch information
3 people authored Jun 15, 2020
1 parent cdd245c commit 818ee65
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Binary file added pandas/tests/io/data/parquet/simple.parquet
Binary file not shown.
18 changes: 18 additions & 0 deletions pandas/tests/io/test_parquet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" test parquet compat """
import datetime
from distutils.version import LooseVersion
from io import BytesIO
import locale
import os
from warnings import catch_warnings
Expand Down Expand Up @@ -494,6 +495,23 @@ def test_s3_roundtrip(self, df_compat, s3_resource, pa):
# GH #19134
check_round_trip(df_compat, pa, path="s3://pandas-test/pyarrow.parquet")

@tm.network
@td.skip_if_no("pyarrow")
def test_parquet_read_from_url(self, df_compat):
url = (
"https://raw.githubusercontent.com/pandas-dev/pandas/"
"master/pandas/tests/io/data/parquet/simple.parquet"
)
df = pd.read_parquet(url)
tm.assert_frame_equal(df, df_compat)

@td.skip_if_no("pyarrow")
def test_read_file_like_obj_support(self, df_compat):
buffer = BytesIO()
df_compat.to_parquet(buffer)
df_from_buf = pd.read_parquet(buffer)
tm.assert_frame_equal(df_compat, df_from_buf)

def test_partition_cols_supported(self, pa, df_full):
# GH #23283
partition_cols = ["bool", "int"]
Expand Down

0 comments on commit 818ee65

Please sign in to comment.