Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@islem-esi
Copy link

No description provided.

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Nov 15, 2022
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Nov 15, 2022
Copy link
Member

@rohan100jain rohan100jain left a comment

Choose a reason for hiding this comment

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

In general, lets keep it as ValueError but thanks for improving the error messages!

raise ValueError("Incorrect number of elements in range")
elif not isinstance(item[0], (int, float)):
raise ValueError("Incorrect type in the 1st element of range: %s" %
raise TypeError("Incorrect type in the 1st element of range: %s" %
Copy link
Member

Choose a reason for hiding this comment

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

Lets keep these as ValueError? Or we'll have to update the Raises: section as well. Typically in TF we just throw ValueError for any input validation problems.

Copy link
Author

Choose a reason for hiding this comment

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

Oh, I see, I was just following the Python documentation :

ValueError

Raised when an operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception such as IndexError.

type(item[0]))
elif not isinstance(item[1], (int, float)):
raise ValueError("Incorrect type in the 2nd element of range: %s" %
raise TypeError("Incorrect type in the 2nd element of range: %s" %
Copy link
Member

Choose a reason for hiding this comment

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

ditto

command_parser.parse_ranges("[inf]")

with self.assertRaisesRegex(ValueError,
with self.assertRaisesRegex(TypeError,
Copy link
Member

Choose a reason for hiding this comment

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

Lets keep it as ValueError

@caisq caisq removed their request for review November 16, 2022 16:31
@tensorflowbutler tensorflowbutler removed the awaiting review Pull request awaiting review label Nov 20, 2022
@gbaned gbaned requested a review from rohan100jain November 24, 2022 23:12
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Nov 24, 2022
@gbaned
Copy link
Contributor

gbaned commented Dec 29, 2022

@islem-esi Can you please resolve conflicts? Thank you!

@gbaned gbaned added stat:awaiting response Status - Awaiting response from author and removed awaiting review Pull request awaiting review labels Dec 29, 2022
@rohan100jain
Copy link
Member

There are still a couple of TypeError's that should become ValueErrors

@gbaned
Copy link
Contributor

gbaned commented Mar 21, 2023

Hi @islem-esi Can you please check @rohan100jain's comments and keep us posted ? Thank you!

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Apr 5, 2023
@github-actions
Copy link

This PR was closed because it has been inactive for 14 days since being marked as stale. Please reopen if you'd like to work on this further.

@github-actions github-actions bot closed this Apr 19, 2023
@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S CL Change Size: Small stale This label marks the issue/pr stale - to be closed automatically if no activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants