BUG: User-facing AssertionError in Series.to_timestamp
See original GitHub issue-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
In [5]: import pandas as pd
In [6]: pd.Series([0]).to_timestamp()
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-6-1a9d08d7daba> in <module>
----> 1 pd.Series([0]).to_timestamp()
~/sandbox/pandas/pandas/core/series.py in to_timestamp(self, freq, how, copy)
4565 new_values = new_values.copy()
4566
-> 4567 assert isinstance(self.index, (ABCDatetimeIndex, ABCPeriodIndex))
4568 new_index = self.index.to_timestamp(freq=freq, how=how)
4569 return self._constructor(new_values, index=new_index).__finalize__(
AssertionError:
Problem description
Users shouldn’t see AssertionErrors like this, since they may be disabled when the interpreter starts up.
Expected Output
We probably want this to be a TypeError
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
BUG: pd.testing.assert_frame_equal(..., check_exact ... - GitHub
I have confirmed this bug exists on the latest version of pandas. ... AssertionError: check_exact may only be used with numeric Series ......
Read more >AssertionError when converting a list to dataframe in pandas
I believe the most likely explanation is that the submissions returned from the query don't all have the same number of fields, ...
Read more >What's New — pandas 0.23.3 documentation - PyData |
Bug in Timestamp and DatetimeIndex where passing a Timestamp localized after a DST transition would return a datetime ... New user-facing pandas.api.types.
Read more >What's new — MNE 1.2.2 documentation
PSD plots will now show non-data channels (e.g., misc ) if those channels are explicitly passed to picks , by Daniel McCloy. Fix...
Read more >SAML Login Errors - Salesforce Help
Use the login history to determine whether a login error is related to the SAML assertion or to your SSO configuration. If you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not sure. I would hope that with
but we can make the
assert
for mypy after we’ve done the user-facing check if needed.the assertion was added in #31126 (i…e not yet released)
on 1.0.3