Skip to content

CI/TST Removed Timestamp.now() from tests. #44341 #44448

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

Merged
merged 5 commits into from
Nov 16, 2021

Conversation

Mikhaylov-yv
Copy link
Contributor

Removed Timestamp.now() from tests. #44341

Replaced Timestamp.now () with pd.Timestamp (2021, 1, 1, 12)

@pep8speaks
Copy link

pep8speaks commented Nov 14, 2021

Hello @Mikhaylov-yv! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-11-14 22:54:51 UTC

@jreback jreback added Testing pandas testing functions or related to the test suite Timezones Timezone data dtype labels Nov 14, 2021
@jreback jreback added this to the 1.4 milestone Nov 14, 2021
@jreback
Copy link
Contributor

jreback commented Nov 14, 2021

@Mikhaylov-yv does this cover all the uses in the tests (aside from specifically testing .now()?)

can you merge master.

also wouldn't object to a rule against using Timestamp.now() in testing (exempting the very few cases that we need it); this could be a followup or in this PR

@jreback
Copy link
Contributor

jreback commented Nov 14, 2021

cc @mroeschke

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending green. Looks like there's a few more occurrences that can be addressed in another PR.

@Mikhaylov-yv
Copy link
Contributor Author

Mikhaylov-yv commented Nov 14, 2021

Hello @jreback @mroeschke .

In these tests, Timestamp (2021, 1, 1, 12) is suitable as a replacement for Timestamp.now (). Did I understand correctly?
In order not to duplicate the code, can I make a Timestamp (2021, 1, 1, 12) as a fixture?

Using this example, I wanted to make sure that I was doing it right.

If everything is OK. I will make corrections to all tests where there is a Timestamp.now (). Of course other than those checking the Timestamp.now ().

@mroeschke
Copy link
Member

In order not to duplicate the code, can I make a Timestamp (2021, 1, 1, 12) as a fixture?

Good idea. A new fixed_now_ts fixture would be helpful. Maybe also add minutes, seconds and microseconds to the fixture Timestamp just in case it was significant.

Also not mentioned in the original issue, but this also applies to utcnow where the original method isn't being tested.

@jreback jreback merged commit a56f6ee into pandas-dev:master Nov 16, 2021
@jreback
Copy link
Contributor

jreback commented Nov 16, 2021

thanks @Mikhaylov-yv happy to have you followup with a fixture for the 'now' tests.

@Mikhaylov-yv
Copy link
Contributor Author

@jreback Thanks for the support. I keep working on the problem.

@Mikhaylov-yv Mikhaylov-yv deleted the remov_Timestamp.now branch November 17, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants