Skip to content

Conversation

gwrome
Copy link
Contributor

@gwrome gwrome commented Mar 13, 2019

This is my first contribution, so please be gentle.

For future reference, this error occurs when the two files are written in different minutes. I couldn't break the comparison by feeding the test datetime objects that only changed the seconds, so I assume only the date, hours, and minutes, are encoded.

Anyway, we can't pass False as a keyword argument for time_stamp. It defaults to None, which internally uses the current timestamp, but otherwise expects a datetime.

For testing purposes, it suffice to pass the same arbitrary timestamp as a keyword. That way it encodes the same timestamp into each file, regardless of when the test runs and how long it takes.

Instead of False, we could use a keyword argument like this: {'time_stamp': pd.to_datetime('2019-01-01 00:00')}

@codecov
Copy link

codecov bot commented Mar 13, 2019

Codecov Report

Merging #25714 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #25714   +/-   ##
=======================================
  Coverage   91.24%   91.24%           
=======================================
  Files         172      172           
  Lines       52967    52967           
=======================================
  Hits        48332    48332           
  Misses       4635     4635
Flag Coverage Δ
#multiple 89.82% <ø> (ø) ⬆️
#single 41.74% <ø> (ø) ⬆️

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 dcf7fce...af9ec8e. Read the comment docs.

@TomAugspurger TomAugspurger added this to the 0.24.3 milestone Mar 13, 2019
@TomAugspurger TomAugspurger added IO Stata read_stata, to_stata Unreliable Test Unit tests that occasionally fail labels Mar 13, 2019
@TomAugspurger TomAugspurger merged commit 1017382 into pandas-dev:master Mar 13, 2019
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Mar 13, 2019
@TomAugspurger
Copy link
Contributor

Thanks @gwrome! Nice job, and sorry about misleading you in the issue with the time_stamp argument type.

@gwrome
Copy link
Contributor Author

gwrome commented Mar 13, 2019

You're welcome, glad I could help!

sighingnow added a commit to sighingnow/pandas that referenced this pull request Mar 14, 2019
* master: (22 commits)
  Fixturize tests/frame/test_operators.py (pandas-dev#25641)
  Update ValueError message in corr (pandas-dev#25729)
  DOC: fix some grammar and inconsistency issues in the User Guide (pandas-dev#25728)
  ENH: Add public start, stop, and step attributes to RangeIndex (pandas-dev#25720)
  Make Rolling.apply documentation clearer (pandas-dev#25712)
  pandas-dev#25707 - Fixed flakiness in stata write test (pandas-dev#25714)
  Json normalize nan support (pandas-dev#25619)
  TST: resolve issues with test_constructor_dtype_datetime64 (pandas-dev#24868)
  DEPR: Deprecate box kwarg for to_timedelta and to_datetime (pandas-dev#24486)
  BUG: Preserve name in DatetimeIndex.snap (pandas-dev#25585)
  Fix concat not respecting order of OrderedDict (pandas-dev#25224)
  CLN: remove pandas.core.categorical (pandas-dev#25655)
  TST/CLN: Remove more Panel tests (pandas-dev#25675)
  Pinned pycodestyle (pandas-dev#25701)
  DOC: update date of 0.24.2 release notes (pandas-dev#25699)
  BUG: Fix error in replace with strings that are large numbers (pandas-dev#25616) (pandas-dev#25644)
  BUG: fix usage of na_sentinel with sort=True in factorize() (pandas-dev#25592)
  BUG: Fix to_string output when using header (pandas-dev#16718) (pandas-dev#25602)
  CLN: Remove unused test code (pandas-dev#25670)
  CLN: remove Panel from concat error message (pandas-dev#25676)
  ...

# Conflicts:
#	doc/source/whatsnew/v0.25.0.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Stata read_stata, to_stata Unreliable Test Unit tests that occasionally fail
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants