-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Global parameters can be overridden when instantiating a task #423
Conversation
f6ecf52
to
cbb4991
Compare
Also removed a couple of ways global parameters are special. The only feature separating global variables is now that they can be set on the command line for all tasks. But other than that, global parameters behaves like any other parameter. There was also some issues with leaky state from one test to another - interface_test.py was leaking a mocked no_lock=True parameter which parameter_test.py was relying on. Removed the leak and added --no-lock everywhere in parameter_test.py
cbb4991
to
c419e7f
Compare
@sisidra, is this related to our issues with parameters the other month? |
@Tarrasch |
Regarding the issue with pool – can you make Hadoop tasks and Crunch tasks share the parameter? Eg. class TaskA(Task):
p = Parameter(is_global=True)
class TaskB(Task):
p = TaskA.p |
Yes but I see it as hack and smell. |
I'm not sure I agree. Given that you want to use global parameters (which I'm not convinced about) – how would you otherwise support two classes with the same parameter?
I think #2 makes a lot more sense, and that was part of the original design. Did you refer to the use of parameters on tasks at all? Can you elaborate why you think it's "smell"? |
Btw – I think the discussion above is pretty unrelated to this PR, so please let me know if you don't think I should merge this, or I'll merge it in a few days |
-2
I would be fine with implementation that adds global params overrides only using kwargs. Discussion about global params in general is valid also. 4# is using parameter holder same as EnvironmentParamsContainer (and we probably will refactor to do that)
Problem with this is that in my mind parameter container is not a Task. It is semantically wrong. |
Thanks for catching the issue with positional global params, I'll see what I can do about it. I see what you are saying about the Task-Parameter integration. I don't think it would be super hard to relax the condition that every parameter has to live on a |
Also removed a couple of ways global parameters are special. The only feature separating global variables is now that they can be set on the command line for all tasks. But other than that, global parameters behaves like any other parameter.
There was also some issues with leaky state from one test to another - interface_test.py was leaking a mocked no_lock=True parameter which parameter_test.py was relying on. Removed the leak and added --no-lock everywhere in parameter_test.py