From b17884bdc7fb59a82a528a6893e9ca97e9fbf7f1 Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Fri, 12 Jun 2020 19:17:06 +0100 Subject: [PATCH 1/2] Backport Test Only from PR #34500 on branch 1.0.x (REG: Fix read_parquet from file-like objects) Co-authored-by: Joris Van den Bossche --- pandas/tests/io/data/parquet/simple.parquet | Bin 0 -> 2157 bytes pandas/tests/io/test_parquet.py | 45 ++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 pandas/tests/io/data/parquet/simple.parquet diff --git a/pandas/tests/io/data/parquet/simple.parquet b/pandas/tests/io/data/parquet/simple.parquet new file mode 100644 index 0000000000000000000000000000000000000000..2862a91f508ea225ea9829d4843f330473977134 GIT binary patch literal 2157 zcmcJRUvJ_@5Wo#VBzKDX5S@{cc!;b!bW#b$B;?BJ`miPeOo0SQuyIvI{ug4fjn9AL zkSH&G?kA}Ff%+M$s!x6Fhv@7YXh`Y9>2xc>&d$uv{ARslI7fYsPSGX0*rwBTYLB9r zRDybu_>iRHv9*|Kihe~i1?&W$bdK3sT9}>0!Y4z$-Jk{I%hxzuI+5IZP38YemH#!Bqj#5VJYl=f{FKQ5ww3>7E4Q|BL;7U)Lxp0}zIJ2S z3Y`L;H%TawqIdDkzoFVW$d^fHbJ@ZdJciG!BJ(Fa5uk(l6-8wWOxjf(UGbTpQxB}^ z=*HcZHnT$8@!9wLKRmEg(1FByiZeFY!anOLwgCz!v@BTpf#LTy}YO&e9JyQfmx?u5#GKA5v!gtm`-qfM9yH1V5NQnfRE>~033^=SpL5$ zi0WC2Pb-sTAxG>PN-*>iZ{oFyK}|!W)V((Yk0mnbFj8l}G12iTdTNib@^ocC z?cx2fhC!kbyMSO5j}Xix2+T{T5lDPA5-Zb@)B!ny{ro$@wnDivJd(=YTeUe1RHtK} znY?PuTb=^G!ellUoYswM>y}_fW5KT6sNyB|33c(#Z`Y8i9rkZDrw2L|E!MYMO*j@# zI=)bA-Rq5EgyVE1PRI69x$5g87fR(gw=Au4h9i-)u&?S2eYJ-3$*wHkO{MaNyp1}r z*YBmneno3wCS>Yj#fA7&c_852z{o|$uv#)Cp2QXGs;St+iC!c2K$iM95Ti620B_Sb zWwA0*%Y9e1H4<+)>^IsMWApkMyEX^^dI0CQ_={u3|ghvk5N>EZr>fm??s z`$4+I{Q~{h#Qg(f>4g1iEv(^5sJP$o8vIX4pJ|8$Av$PZJh1C2as7^B;LYHD42|GG lbKU*L>tUZOR*Kxgpo`82&9jSa0e Date: Mon, 15 Jun 2020 09:59:54 +0100 Subject: [PATCH 2/2] isort and remove test_s3_roundtrip_for_dir --- pandas/tests/io/test_parquet.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index b5e1ba19d795b..853b4e754bcd0 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1,8 +1,8 @@ """ test parquet compat """ import datetime from distutils.version import LooseVersion -import locale from io import BytesIO +import locale import os from warnings import catch_warnings @@ -495,33 +495,6 @@ def test_s3_roundtrip(self, df_compat, s3_resource, pa): # GH #19134 check_round_trip(df_compat, pa, path="s3://pandas-test/pyarrow.parquet") - @td.skip_if_no("s3fs") - @pytest.mark.parametrize("partition_col", [["A"], []]) - def test_s3_roundtrip_for_dir(self, df_compat, s3_resource, pa, partition_col): - from pandas.io.s3 import get_fs as get_s3_fs - - # GH #26388 - # https://github.com/apache/arrow/blob/master/python/pyarrow/tests/test_parquet.py#L2716 - # As per pyarrow partitioned columns become 'categorical' dtypes - # and are added to back of dataframe on read - - expected_df = df_compat.copy() - if partition_col: - expected_df[partition_col] = expected_df[partition_col].astype("category") - check_round_trip( - df_compat, - pa, - expected=expected_df, - path="s3://pandas-test/parquet_dir", - write_kwargs={ - "partition_cols": partition_col, - "compression": None, - "filesystem": get_s3_fs(), - }, - check_like=True, - repeat=1, - ) - @tm.network @td.skip_if_no("pyarrow") def test_parquet_read_from_url(self, df_compat):