BUG: Timestamp.round precision error for ns (#15578)
State: closed

 - [x] closes #15578
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master | flake8 --diff``

Nice trick @jreback! `round()` patched for `DatetimeIndex` and `Timestamp` when rounding by ns. 

Labels:
name: Datetime
description: Datetime data dtype
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15588?src=pr&el=h1) Report
> Merging [#15588](https://codecov.io/gh/pandas-dev/pandas/pull/15588?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/7740231bbc0b92db55479cd02400b37c9470a4d2?src=pr&el=desc) will **decrease** coverage by `-0.02%`.
> The diff coverage is `100%`.


```diff
@@            Coverage Diff             @@
##           master   #15588      +/-   ##
==========================================
- Coverage   91.06%   91.04%   -0.02%     
==========================================
  Files         137      137              
  Lines       49307    49315       +8     
==========================================
- Hits        44899    44897       -2     
- Misses       4408     4418      +10
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15588?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/base.py](https://codecov.io/gh/pandas-dev/pandas/compare/7740231bbc0b92db55479cd02400b37c9470a4d2...af95baa60d51a161ad327957ef30c0b29a6ecd3b?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvYmFzZS5weQ==) | `96.65% <100%> (+0.06%)` | :white_check_mark: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/compare/7740231bbc0b92db55479cd02400b37c9470a4d2...af95baa60d51a161ad327957ef30c0b29a6ecd3b?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :x: |
| [pandas/tools/merge.py](https://codecov.io/gh/pandas-dev/pandas/compare/7740231bbc0b92db55479cd02400b37c9470a4d2...af95baa60d51a161ad327957ef30c0b29a6ecd3b?src=pr&el=tree#diff-cGFuZGFzL3Rvb2xzL21lcmdlLnB5) | `91.78% <0%> (-0.35%)` | :x: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/compare/7740231bbc0b92db55479cd02400b37c9470a4d2...af95baa60d51a161ad327957ef30c0b29a6ecd3b?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.83% <0%> (-0.1%)` | :x: |
| [pandas/tseries/index.py](https://codecov.io/gh/pandas-dev/pandas/compare/7740231bbc0b92db55479cd02400b37c9470a4d2...af95baa60d51a161ad327957ef30c0b29a6ecd3b?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvaW5kZXgucHk=) | `95.42% <0%> (+0.09%)` | :white_check_mark: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15588?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15588?src=pr&el=footer). Last update [7740231...af95baa](https://codecov.io/gh/pandas-dev/pandas/compare/7740231bbc0b92db55479cd02400b37c9470a4d2...af95baa60d51a161ad327957ef30c0b29a6ecd3b?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Altered the logic and now will raise a warning for an invalid frequency like `1010ns`
thanks @mroeschke 

keep em coming!