Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPAT: handle pyarrow deprecation of timestamps_to_ms in .from_pandas with pyarrow < 0.6.0 #17447

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 6, 2017

closes #17438

@jreback jreback added Compat pandas objects compatability with Numpy or Python functions IO Data IO issues that don't fit into a more specific label labels Sep 6, 2017
@jreback jreback added this to the 0.21.0 milestone Sep 6, 2017
@codecov
Copy link

codecov bot commented Sep 6, 2017

Codecov Report

Merging #17447 into master will decrease coverage by 0.02%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17447      +/-   ##
==========================================
- Coverage   91.16%   91.14%   -0.03%     
==========================================
  Files         163      163              
  Lines       49581    49586       +5     
==========================================
- Hits        45199    45193       -6     
- Misses       4382     4393      +11
Flag Coverage Δ
#multiple 88.92% <75%> (-0.01%) ⬇️
#single 40.25% <12.5%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/io/parquet.py 65.38% <75%> (-0.37%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.72% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bca6ce...ea2ff0c. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 6, 2017

Codecov Report

Merging #17447 into master will decrease coverage by 0.02%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17447      +/-   ##
==========================================
- Coverage   91.16%   91.14%   -0.03%     
==========================================
  Files         163      163              
  Lines       49581    49586       +5     
==========================================
- Hits        45199    45193       -6     
- Misses       4382     4393      +11
Flag Coverage Δ
#multiple 88.92% <75%> (-0.01%) ⬇️
#single 40.25% <12.5%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/io/parquet.py 65.38% <75%> (-0.37%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.72% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bca6ce...ea2ff0c. Read the comment docs.

@jreback jreback merged commit 84a39f9 into pandas-dev:master Sep 6, 2017
@wesm
Copy link
Member

wesm commented Sep 6, 2017

👍, thanks @jreback!

@jreback jreback added the IO Parquet parquet, feather label Sep 6, 2017
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Sep 10, 2017
@jorisvandenbossche
Copy link
Member

Possibly related to this (didn't look into detail, but just saw this error in the doc builds):

>>>-------------------------------------------------------------------------
Exception in /tmp/doc/source/io.rst at block ending on line 4530
Specify :okexcept: as an option in the ipython:: block to suppress this message
---------------------------------------------------------------------------
ArrowInvalid                              Traceback (most recent call last)
<ipython-input-501-033b23d0b657> in <module>()
----> 1 df.to_parquet('example_pa.parquet', engine='pyarrow')
~/build/pandas-dev/pandas/pandas/core/frame.py in to_parquet(self, fname, engine, compression, **kwargs)
   1620         from pandas.io.parquet import to_parquet
   1621         to_parquet(self, fname, engine,
-> 1622                    compression=compression, **kwargs)
   1623 
   1624     @Substitution(header='Write out the column names. If a list of strings '
~/build/pandas-dev/pandas/pandas/io/parquet.py in to_parquet(df, path, engine, compression, **kwargs)
    176         raise ValueError("parquet must have string column names")
    177 
--> 178     return impl.write(df, path, compression=compression)
    179 
    180 
~/build/pandas-dev/pandas/pandas/io/parquet.py in write(self, df, path, compression, coerce_timestamps, **kwargs)
     75             self.api.parquet.write_table(
     76                 table, path, compression=compression,
---> 77                 coerce_timestamps=coerce_timestamps, **kwargs)
     78 
     79     def read(self, path):
~/miniconda3/envs/pandas/lib/python3.6/site-packages/pyarrow/parquet.py in write_table(table, where, row_group_size, version, use_dictionary, compression, use_deprecated_int96_timestamps, coerce_timestamps, **kwargs)
    794     try:
    795         writer = ParquetWriter(where, table.schema, **options)
--> 796         writer.write_table(table, row_group_size=row_group_size)
    797     except:
    798         if writer is not None:
_parquet.pyx in pyarrow._parquet.ParquetWriter.write_table()
error.pxi in pyarrow.lib.check_status()
ArrowInvalid: Casting from timestamp[ns] to timestamp[ms] would lose data: 1356998400000000001

<<<-------------------------------------------------------------------------

Failing example in the docs: https://pandas-docs.github.io/pandas-docs-travis/io.html#parquet

@jreback
Copy link
Contributor Author

jreback commented Sep 12, 2017

I pushed a fix for #17447 (comment) @jorisvandenbossche

jowens pushed a commit to jowens/pandas that referenced this pull request Sep 20, 2017
alanbato pushed a commit to alanbato/pandas that referenced this pull request Nov 10, 2017
No-Stream pushed a commit to No-Stream/pandas that referenced this pull request Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions IO Data IO issues that don't fit into a more specific label IO Parquet parquet, feather
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLN: pyarrow 0.6.0 compat, we need to handle back-compat on this
3 participants