Skip to content

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
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