-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add wait for status update #186
Changes from all commits
d26a886
304ae4a
862b08e
ae043ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,11 +59,12 @@ def standard_config(self, standard_config: Union[turing.generated.models.Ensembl | |
if isinstance(standard_config, turing.generated.models.EnsemblerStandardConfig): | ||
self._standard_config = standard_config | ||
elif isinstance(standard_config, dict): | ||
standard_config['experiment_mappings'] = [ | ||
openapi_standard_config = standard_config.copy() | ||
openapi_standard_config['experiment_mappings'] = [ | ||
turing.generated.models.EnsemblerStandardConfigExperimentMappings(**mapping) | ||
for mapping in standard_config['experiment_mappings'] | ||
] | ||
self._standard_config = turing.generated.models.EnsemblerStandardConfig(**standard_config) | ||
self._standard_config = turing.generated.models.EnsemblerStandardConfig(**openapi_standard_config) | ||
else: | ||
self._standard_config = standard_config | ||
|
||
|
@@ -76,11 +77,12 @@ def docker_config(self, docker_config: turing.generated.models.EnsemblerDockerCo | |
if isinstance(docker_config, turing.generated.models.EnsemblerDockerConfig): | ||
self._docker_config = docker_config | ||
elif isinstance(docker_config, dict): | ||
docker_config['resource_request'] = \ | ||
turing.generated.models.ResourceRequest(**docker_config['resource_request']) | ||
docker_config['env'] = [turing.generated.models.EnvVar(**env_var) for env_var in docker_config['env']] | ||
openapi_docker_config = docker_config.copy() | ||
openapi_docker_config['resource_request'] = \ | ||
turing.generated.models.ResourceRequest(**openapi_docker_config['resource_request']) | ||
openapi_docker_config['env'] = [turing.generated.models.EnvVar(**env_var) for env_var in openapi_docker_config['env']] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've made some additional changes - they look pretty minor but they were causing some bugs in the unit tests after the refactoring suggested earlier. Essentially, the previous implementation of the setter methods were mutating the dictionaries that were being passed to it as arguments, which is dangerous and might lead to unintended effects. These new changes simply create new working dictionaries that are only used within the scope of the setter. cc @krithika369 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. Thanks for addressing them. We need to propagate these changes to main later as well. |
||
self._docker_config = turing.generated.models.EnsemblerDockerConfig( | ||
**docker_config | ||
**openapi_docker_config | ||
) | ||
else: | ||
self._docker_config = docker_config | ||
|
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 issue as the one I just commented on, though the fix here was to simply reorder the statements.