-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: fixed cython doctests #43768
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
TST: fixed cython doctests #43768
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, good to see this happening!
Couple of questions:
- In Python docstrings, you can add lines with descriptions between examples (e.g. in https://pandas.pydata.org/pandas-docs/stable/development/contributing_docstring.html#section-7-examples) - is that not possible for Cython docstrings?
- Is it possible to not skip the
tz_standardize
tests, for example by constructingtz
?
thanks @MarcoGorelli for reviewing this!
So currently, only two tests are being skipped, i.e. last example in Edit - Another point worth highlighting, is the below is failing on my local (as the output is different than from the CI).
|
pandas/_libs/tslibs/timezones.pyx
Outdated
dateutil.tz.tz.tzutc | ||
|
||
>>> tz_standardize(tz) | ||
>>> tz_standardize(tz) # doctest: +SKIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this need skipping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not able to replicate this example
In [33]: from dateutil.tz.tz import tzutc as tz
In [34]: tz
Out[34]: dateutil.tz.tz.tzutc
In [35]: from pandas._libs.tslibs.timezones import tz_standardize
In [36]: tz_standardize(tz)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-36-94d2ff882b92> in <module>
----> 1 tz_standardize(tz)
TypeError: Argument 'tz' has incorrect type (expected datetime.tzinfo, got _TzSingleton)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreback sorry to unresolve this, but can this example be removed if it can't be run?
Co-authored-by: Marco Edward Gorelli <[email protected]>
This is going to depend on what timezone you are in locally. |
would be a good idea to skip this no? (or maybe make it timezone independent if possible, to ensure it doesn't fail in anyones local) |
IMO the
test can be removed, if it doesn't run. Other than that, the rest looks good to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @debnathshoham i suppose that if we had more doc-tests in cython this would pick them up. if someone wants to create an issue about adding more doc-strings wouldn't object (for example there is an older PR that adds a ton to the timestamp functions). |
Skipped some of the tests which were failing