Skip to content
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

change edit_api to reflect server #941

Merged
merged 4 commits into from
Aug 31, 2020
Merged

change edit_api to reflect server #941

merged 4 commits into from
Aug 31, 2020

Conversation

sahithyaravi
Copy link
Member

@sahithyaravi sahithyaravi commented Aug 19, 2020

Reference Issue

#929

What does this PR implement/fix? Explain your changes.

The server has made changes to the edit_api. Refer openml/OpenML#1058.
Summary of the changes:
Edit API - Edit non-critical data fields for everyone. Edit critical fields only for the owner, provided there are no tasks. If the owner already created a task, we will just throw an error.

Fork API - Clone the row as such with change in dataset ID and uploader ID.

How should this PR be tested?

Any other comments?

  1. Fork API changes will be made in a new PR. This is more urgent as it is breaking the openml-python build.
  2. Note that "data" changes are not supported. If the data itself requires changes, the user has to create a new dataset. We will not be doing this through edit API or fork API, as it changes the arff file.
  3. In future we want to support versioning for descriptions (For now we allow direct changes without any version history.)

Copy link
Collaborator

@PGijsbers PGijsbers left a comment

Choose a reason for hiding this comment

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

Do we want to allow everyone to edit the data? Is this temporary? I can't imagine this is healthy long term, someone will come along and be destructive.

Of course we do still need a way for other users to at least suggest changes to be approved by the original uploader or someone from openml (hopefully mostly the former). Are there plans for this?

tests/test_datasets/test_dataset_functions.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2020

Codecov Report

Merging #941 into develop will decrease coverage by 0.28%.
The diff coverage is 81.77%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #941      +/-   ##
===========================================
- Coverage    88.06%   87.77%   -0.29%     
===========================================
  Files           37       37              
  Lines         4364     4427      +63     
===========================================
+ Hits          3843     3886      +43     
- Misses         521      541      +20     
Impacted Files Coverage Δ
openml/datasets/__init__.py 100.00% <ø> (ø)
openml/exceptions.py 93.54% <0.00%> (ø)
openml/extensions/__init__.py 100.00% <ø> (ø)
openml/flows/__init__.py 100.00% <ø> (ø)
openml/runs/__init__.py 100.00% <ø> (ø)
openml/study/__init__.py 100.00% <ø> (ø)
openml/tasks/__init__.py 100.00% <ø> (ø)
openml/setups/setup.py 44.00% <9.09%> (ø)
openml/evaluations/evaluation.py 66.66% <20.00%> (ø)
openml/datasets/data_feature.py 68.00% <33.33%> (ø)
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d2e0ce...cfa2513. Read the comment docs.

@mfeurer
Copy link
Collaborator

mfeurer commented Aug 27, 2020

Do we want to allow everyone to edit the data? Is this temporary?

Reading this, I'm also a bit worried about this.

@sahithyaravi
Copy link
Member Author

Do we want to allow everyone to edit the data? Is this temporary?

Reading this, I'm also a bit worried about this.

It is temporary that everyone can edit non-critical fields.
This is to avoid unnecessary forks(even with the same file ID) for changes to a non-critical field such as citation, paper_url etc.
For now, description also falls under non-critical category.
However, In the near future, we plan to:

  1. We will provide a choice to the owner of the dataset to allow/disallow non-critical data edits from the community. If the owner chooses not to allow this, then only the owner can perform edits.
  2. We will support versioning for dataset descriptions. This way we dont need different dataset versions for a change in description.

@mfeurer
Copy link
Collaborator

mfeurer commented Aug 27, 2020

It is temporary that everyone can edit non-critical fields.

Wouldn't it make sense to at least restrict this to registered users?

@sahithyaravi
Copy link
Member Author

sahithyaravi commented Aug 27, 2020

It is temporary that everyone can edit non-critical fields.

Wouldn't it make sense to at least restrict this to registered users?

yes only registered users can do this , otherwise the server will throw an error "Authentication failed". I checked this through a post request for edit and fork APIS but, I think this is true for all requests that are not "get".

Copy link
Collaborator

@mfeurer mfeurer left a comment

Choose a reason for hiding this comment

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

This looks good to me, although I would prefer to have a bit more text in the tutorial what critical and non-critical fields are.

examples/30_extended/datasets_tutorial.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@PGijsbers PGijsbers left a comment

Choose a reason for hiding this comment

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

Looks good to me. We might want to refer to the documentation on API key configuration rather than leaving the commented out code in (https://openml.github.io/openml-python/master/examples/20_basic/introduction_tutorial.html#sphx-glr-examples-20-basic-introduction-tutorial-py). Either way works for me. I'll leave the merge for @mfeurer since he had left feedback on the PR.

@mfeurer mfeurer merged commit f70c720 into develop Aug 31, 2020
@mfeurer mfeurer deleted the edit_api_changes branch August 31, 2020 18:27
mfeurer pushed a commit that referenced this pull request Sep 2, 2020
* Create first section: Creating Custom Flow

* Add Section: Using the Flow

It is incomplete as while trying to explain how to format the
predictions, I realized a utility function is required.

* Allow run description text to be custom

Previously the description text that accompanies the prediction file was
auto-generated with the assumption that the corresponding flow had an
extension. To support custom flows (with no extension), this behavior
had to be changed. The description can now be passed on initialization.
The description describing it was auto generated from run_task is now
correctly only added if the run was generated through run_flow_on_task.

* Draft for Custom Flow tutorial

* Add minimal docstring to OpenMLRun

I am not for each field what the specifications are.

* Process code review feedback

In particular:
 - text changes
 - fetch true labels from the dataset instead

* Use the format utility function in automatic runs

To format the predictions.

* Process @mfeurer feedback

* Rename arguments of list_evaluations (#933)

* list evals name change

* list evals - update

* adding config file to user guide (#931)

* adding config file to user guide

* finished requested changes

* Edit api (#935)

* version1

* minor fixes

* tests

* reformat code

* check new version

* remove get data

* code format

* review comments

* fix duplicate

* type annotate

* example

* tests for exceptions

* fix pep8

* black format

* Adding support for scikit-learn > 0.22 (#936)

* Preliminary changes

* Updating unit tests for sklearn 0.22 and above

* Triggering sklearn tests + fixes

* Refactoring to inspect.signature in extensions

* Add flake8-print in pre-commit (#939)

* Add flake8-print in pre-commit config

* Replace print statements with logging

* Fix edit api (#940)

* fix edit api

* Update subflow paragraph

* Check the ClassificationTask has class label set

* Test task is of supported type

* Add tests for format_prediction

* Adding Python 3.8 support (#916)

* Adding Python 3.8 support

* Fixing indentation

* Execute test cases for 3.8

* Testing

* Making install script fail

* Process feedback Neeratyoy

* Test Exception with Regex

Also throw NotImplementedError instead of TypeError for unsupported task
types. Added links in the example.

* change edit_api to reflect server (#941)

* change edit_api to reflect server

* change test and example to reflect rest API changes

* tutorial comments

* Update datasets_tutorial.py

* Create first section: Creating Custom Flow

* Add Section: Using the Flow

It is incomplete as while trying to explain how to format the
predictions, I realized a utility function is required.

* Allow run description text to be custom

Previously the description text that accompanies the prediction file was
auto-generated with the assumption that the corresponding flow had an
extension. To support custom flows (with no extension), this behavior
had to be changed. The description can now be passed on initialization.
The description describing it was auto generated from run_task is now
correctly only added if the run was generated through run_flow_on_task.

* Draft for Custom Flow tutorial

* Add minimal docstring to OpenMLRun

I am not for each field what the specifications are.

* Process code review feedback

In particular:
 - text changes
 - fetch true labels from the dataset instead

* Use the format utility function in automatic runs

To format the predictions.

* Process @mfeurer feedback

* Update subflow paragraph

* Check the ClassificationTask has class label set

* Test task is of supported type

* Add tests for format_prediction

* Process feedback Neeratyoy

* Test Exception with Regex

Also throw NotImplementedError instead of TypeError for unsupported task
types. Added links in the example.

Co-authored-by: Bilgecelik <38037323+Bilgecelik@users.noreply.github.com>
Co-authored-by: marcoslbueno <38478211+marcoslbueno@users.noreply.github.com>
Co-authored-by: Sahithya Ravi <44670788+sahithyaravi1493@users.noreply.github.com>
Co-authored-by: Neeratyoy Mallik <neeratyoy@gmail.com>
Co-authored-by: zikun <33176974+zikun@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants