Skip to content

ERR: better error reporting for failing parsing in timedelta/timeseries #10720 #10883

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

Closed
wants to merge 2 commits into from

Conversation

springcoil
Copy link
Contributor

closes #10720

@springcoil springcoil closed this Aug 22, 2015
@jorisvandenbossche
Copy link
Member

Why did you close this one?

@jorisvandenbossche
Copy link
Member

Some advice:

  • always work on a branch and not in master for a PR (so this one is better than BUG: 10720 - Test error message enhancement #10884, I can reopen this one if you want)

  • always update with the latest upstream before starting a new branch (you have still some old commits of a previous pr):

    git checkout master
    git fetch upstream
    git merge upstream/master --ff-only
    git checkout -b new_branch
    

    or now if you already started a branch, rebase it on master:

    git fetch upstream
    git rebase upstream/master
    

@springcoil
Copy link
Contributor Author

Ohh i closed the other one because i wanted to rebase. Thanks for the tip

On Saturday, 22 August 2015, Joris Van den Bossche [email protected]
wrote:

Some advice:


Reply to this email directly or view it on GitHub
#10883 (comment).

Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com

@springcoil
Copy link
Contributor Author

Can you reopen this one instead and close the other one?

slight update
@jreback jreback added Datetime Datetime data dtype Timedelta Timedelta data type labels Aug 22, 2015
@jreback jreback changed the title BUG: 10720 ERR: better error reporting for failing parsing in timedelta/timeseries #10720 Aug 22, 2015
@springcoil
Copy link
Contributor Author

Ok - so that attempt passed, any got any feedback about whether it's ready to be merged or does it need some more work?

@@ -923,8 +923,8 @@ def test_to_datetime_with_apply(self):
assert_series_equal(result, expected)

td = pd.Series(['May 04', 'Jun 02', ''], index=[1,2,3])
self.assertRaises(ValueError, lambda : pd.to_datetime(td,format='%b %y', errors='raise'))
self.assertRaises(ValueError, lambda : td.apply(pd.to_datetime, format='%b %y', errors='raise'))
self.assertRaises(ValueError, 'Unknown string format. You can coerce errors to NaT by passing coerce', lambda : pd.to_datetime(td,format='%b %y', errors='raise'))
Copy link
Contributor

Choose a reason for hiding this comment

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

his is not doing anything

use assertRaisesRegExp

@springcoil
Copy link
Contributor Author

Seems ready

@jreback
Copy link
Contributor

jreback commented Aug 22, 2015

@springcoil this doesn't do anything. as you didn't actually change any code except for the tests. So this fails. And it still is not rebased on master.

In [1]: td = pd.Series(['May 04', 'Jun 02', ''], index=[1,2,3])

In [3]: pd.to_datetime(td,format='%b %y', errors='raise') 
ValueError: time data '' does not match format '%b %y' (match)

@springcoil
Copy link
Contributor Author

Ok will fix that

On Saturday, 22 August 2015, Jeff Reback [email protected] wrote:

@springcoil https://github.com/springcoil this doesn't do anything. as
you didn't actually change any code except for the tests. So this fails.
And it still is not rebased on master.

In [1]: td = pd.Series(['May 04', 'Jun 02', ''], index=[1,2,3])

In [3]: pd.to_datetime(td,format='%b %y', errors='raise')
ValueError: time data '' does not match format '%b %y' (match)


Reply to this email directly or view it on GitHub
#10883 (comment).

Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com

@springcoil
Copy link
Contributor Author

I'm going to close this for now.

@springcoil springcoil closed this Aug 30, 2015
@springcoil springcoil deleted the 10720 branch August 30, 2015 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC/ERR: better error message on unsuccessful datetime parsing
3 participants