You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After @ArlindKadra figured this out I had a brief look at how we could tackle this. All this is based on the premise that we have examples and tutorials in CI to make sure that they keep on working (which rules out the option to comment out code in the tutorial).
Work only on the test server. This appears to be pretty boring as there aren't a lot of results for tasks.
Only do the uploads to the test server, however, we would not get them if we download all previous results from the live server.
Split up the tutorial page into several smaller tutorials in which analysis of runs and upload of runs are separate scripts. Then we could redirect the uploads to the test server without making the other example boring.
@joaquinvanschoren what do you think about the last solution? You would need to use separate notebooks for presentation then.
On 13 Mar 2018 09:31, "Matthias Feurer" ***@***.***> wrote:
After @ArlindKadra <https://github.com/arlindkadra> figured this out I
had a brief look at how we could tackle this. All this is based on the
premise that we have examples and tutorials in CI to make sure that they
keep on working (which rules out the option to comment out code in the
tutorial).
1. Work only on the test server. This appears to be pretty boring as
there aren't a lot of results for tasks.
2. Only do the uploads to the test server, however, we would not get
them if we download all previous results from the live server.
3. Split up the tutorial page into several smaller tutorials in which
analysis of runs and upload of runs are separate scripts. Then we could
redirect the uploads to the test server without making the other example
boring.
@joaquinvanschoren <https://github.com/joaquinvanschoren> what do you
think about the last solution? You would need to use separate notebooks for
presentation then.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#392 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACL7-ppwiIisv7LyX4SpxHngaCw3uT_nks5td8oagaJpZM4R9YUu>
.
Yes, but one would have to catch that either outside of the notebook (and therefore not fully test it). I also think that we mock out the upload calls. Then the notebook will behave like before, there just will be no runs on the live server.
What does mocking out mean?
Ideally you want an example where you upload a dataset/flow/run and then
download it again. That should only be done on the test server.
What about using environment variables? You could set them before you do
the uploading part (something like OPENML_UPLOAD_SERVER=... ) and then read
them in the notebook. I.e. if that variable exists then change the target
server.
Or: it wouldn’t hurt if we change the target server explicitly in the
example? Users can always comment that out if they want to push to
production.
On Wed, 14 Mar 2018 at 08:23, Matthias Feurer ***@***.***> wrote:
Yes, but one would have to catch that either outside of the notebook (and
therefore not fully test it). I also think that we mock out the upload
calls. Then the notebook will behave like before, there just will be no
runs on the live server.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#392 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABpQV66IV3a7Nmro-KLQ6jpAZiZ11JVuks5teMVmgaJpZM4R9YUu>
.
No one had time so far to do something about this. I just tried this, but the solution using unittest.mock did not work (see below for a snippet). I will have to check this next Tuesday.
@mock.patch('openml._api_calls._perform_api_call')
def test_tutorial(self, patch):
def side_effect(*args, **kwargs):
if (
args[0].endswith('/run/')
and kwargs['file_elements'] is not None
):
raise ValueError('Not uploading a run!')
else:
return mock.DEFAULT
patch.side_effect = side_effect
self._test_notebook('OpenML_Tutorial.ipynb', patch)
self.assertEqual(patch.call_count, 2)
@mfeurer A solution is:
setting the config.server to the production server in the setup
changing the config.server to the test server in the test_openml_param_name_to_sklearn unittest
Activity
joaquinvanschoren commentedon Mar 7, 2018
@janvanrijn @mfeurer can you take a look at this? I'm still seeing lots of CI runs streaming in on production...
mfeurer commentedon Mar 7, 2018
@ArlindKadra could you please prioritize this?
ArlindKadra commentedon Mar 7, 2018
@joaquinvanschoren @mfeurer sure thing. I found out the problem.
joaquinvanschoren commentedon Mar 7, 2018
Thanks!
ArlindKadra commentedon Mar 7, 2018
@mfeurer The problem is in the OpenML_Tutorial.ipynb at tests/test_examples/. We are uploading runs to the production server with Travis.
joaquinvanschoren commentedon Mar 7, 2018
ArlindKadra commentedon Mar 7, 2018
Yeah sure, we can go with the first option.
mfeurer commentedon Mar 13, 2018
After @ArlindKadra figured this out I had a brief look at how we could tackle this. All this is based on the premise that we have examples and tutorials in CI to make sure that they keep on working (which rules out the option to comment out code in the tutorial).
@joaquinvanschoren what do you think about the last solution? You would need to use separate notebooks for presentation then.
janvanrijn commentedon Mar 13, 2018
mfeurer commentedon Mar 13, 2018
Wouldn't that give an exception?
janvanrijn commentedon Mar 13, 2018
One that you can predict and potentially catch
mfeurer commentedon Mar 14, 2018
Yes, but one would have to catch that either outside of the notebook (and therefore not fully test it). I also think that we mock out the upload calls. Then the notebook will behave like before, there just will be no runs on the live server.
joaquinvanschoren commentedon Mar 14, 2018
3 remaining items
joaquinvanschoren commentedon Mar 25, 2018
FYI, this is still happening.
Can we do the testing without uploading test runs to the production server?
mfeurer commentedon Mar 29, 2018
No one had time so far to do something about this. I just tried this, but the solution using
unittest.mockdid not work (see below for a snippet). I will have to check this next Tuesday.mfeurer commentedon Apr 3, 2018
I just opened a PR at #430.
Fix/#392 (#430)
mfeurer commentedon Apr 6, 2018
Fixed via #430.
joaquinvanschoren commentedon Dec 13, 2018
It's happening again:
https://www.openml.org/r/9912434
mfeurer commentedon Dec 17, 2018
Hm, I can't reproduce this locally... @ArlindKadra could you please look into this?
ArlindKadra commentedon Dec 18, 2018
@mfeurer It is from the recent pull request regarding flows that was merged into development.
openml-python/tests/test_flows/test_sklearn.py
Lines 994 to 1005 in 7c0a77d
The class does not extend OpenML's TestCase but the unittest one. That is why it is publishing at the main server.
openml-python/tests/test_flows/test_sklearn.py
Line 59 in 7c0a77d
ArlindKadra commentedon Dec 18, 2018
@mfeurer A solution is:
setting the config.server to the production server in the setup
changing the config.server to the test server in the test_openml_param_name_to_sklearn unittest
mfeurer commentedon Dec 19, 2018
Thanks @ArlindKadra for checking. I just created PR #609 to subclass all test cases from OpenML's core test case which hopefully fixes this issue.
ArlindKadra commentedon Dec 19, 2018
@mfeurer that is actually better, I am surprised that the sklearn tests did not make use of any tasks from the production server.
mfeurer commentedon Jan 29, 2019
Okay fixed again via #609.