-
Notifications
You must be signed in to change notification settings - Fork 3k
[CI] Fix some warnings #4547
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
[CI] Fix some warnings #4547
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
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 a lot: great to get rid off all warning messages!!!
src/datasets/arrow_dataset.py
Outdated
| np_arrays.append(np.array(array)) | ||
|
|
||
| if np.issubdtype(np_arrays[0].dtype, np.integer) or np_arrays[0].dtype == np.bool: | ||
| if np.issubdtype(np_arrays[0].dtype, np.integer) or np_arrays[0].dtype == np.dtype("bool"): |
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.
The warning message suggests to use bool instead.
| if np.issubdtype(np_arrays[0].dtype, np.integer) or np_arrays[0].dtype == np.dtype("bool"): | |
| if np.issubdtype(np_arrays[0].dtype, np.integer) or np_arrays[0].dtype == bool: |
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.
Done, and for object as well
| from datasets.commands.env import EnvironmentCommand | ||
| from datasets.commands.run_beam import RunBeamCommand | ||
| from datasets.commands.test import TestCommand | ||
| from datasets.commands.test import CLITestCommand |
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.
You are preceding with CLI only the TestCommand; i.e. the rest of the command names are not preceded by CLI.
IMHO, either all or none should be preceded by CLI.
On the other hand, from your commit message, I guess you introduce this modification to prevent pytest default test discovery to identify this class as a test. If this is the reason, I would strongly suggest using testpaths instead: https://docs.pytest.org/en/latest/reference/reference.html#confval-testpaths
We tellpytestto search for tests only inside thetestsdirectoryMoreover, tests discovery/collection will be faster
I just realized pytest is called with arg ./tests... I did not consider imported classes as possible test candidates, thus I thought pytest was called without arguments and it was searching inside src to find TestCommand. Sorry for the confusion.
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.
pytest suggests adding the class attribute __test__ = False to TestCommand, but I am not sure if this is better... :/
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 went for __test__ = False since it's simpler
| if data_struct.dtype == np.dtype( | ||
| "object" |
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.
Same as above.
| if data_struct.dtype == np.dtype( | |
| "object" | |
| if ( | |
| data_struct.dtype == object |
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.
This is not resolved yet.
| if data_struct.dtype == np.dtype( | ||
| "object" | ||
| ): # pytorch tensors cannot be instantied from an array of objects |
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.
Same.
| if data_struct.dtype == np.dtype( | |
| "object" | |
| ): # pytorch tensors cannot be instantied from an array of objects | |
| if data_struct.dtype == object: # pytorch tensors cannot be instantied from an array of objects |
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.
This is not resolved yet.
|
There is a CI failure only related to the missing content of the universal_dependencies dataset card, we can ignore this failure in this PR |
albertvillanova
left a comment
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.
Just some leftovers to be fixed before merging.
| from datasets.commands.env import EnvironmentCommand | ||
| from datasets.commands.run_beam import RunBeamCommand | ||
| from datasets.commands.test import TestCommand | ||
| from datasets.commands.test import CLITestCommand |
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.
Please note there are still some CLI... leftovers you should fix before merging.
| ConvertCommand.register_subcommand(commands_parser) | ||
| EnvironmentCommand.register_subcommand(commands_parser) | ||
| TestCommand.register_subcommand(commands_parser) | ||
| CLITestCommand.register_subcommand(commands_parser) |
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.
Same as above...
| if data_struct.dtype == np.dtype( | ||
| "object" |
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.
This is not resolved yet.
| if data_struct.dtype == np.dtype( | ||
| "object" | ||
| ): # pytorch tensors cannot be instantied from an array of objects |
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.
This is not resolved yet.
|
good catch, I thought I resolved them all sorry |
|
Alright it should be good now |
albertvillanova
left a comment
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.
Thank you!!!
There are some warnings in the CI that are annoying, I tried to remove most of them