Skip to content

REF: _reso->_creso #49107

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 1 commit into from
Oct 15, 2022
Merged

REF: _reso->_creso #49107

merged 1 commit into from
Oct 15, 2022

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@phofl phofl added this to the 2.0 milestone Oct 15, 2022
@phofl phofl merged commit 90b4add into pandas-dev:main Oct 15, 2022
@phofl
Copy link
Member

phofl commented Oct 15, 2022

thx @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-reso-creso-3 branch October 15, 2022 15:44
abkosar pushed a commit to abkosar/pandas that referenced this pull request Oct 22, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
@@ -2103,7 +2103,7 @@ def _round(self, freq, mode, ambiguous, nonexistent):
values = self.view("i8")
values = cast(np.ndarray, values)
nanos = to_offset(freq).nanos # raises on non-fixed frequencies
nanos = delta_to_nanoseconds(to_offset(freq), self._reso)
nanos = delta_to_nanoseconds(to_offset(freq), self._creso)

Choose a reason for hiding this comment

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

This discards the result of the previous line. I wonder why the previous line is still needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

the previous line likely shouldn't assign nanos =. It is just accessing .nanos so that we get the right exception message if that raises

Choose a reason for hiding this comment

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

... we get the right exception message if that raises

That's exactly how I got there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants