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

[17.09] Allow get_history calls with create=False when evaluation workflows. #4997

Merged
merged 1 commit into from Nov 16, 2017

Conversation

Projects
None yet
3 participants
@jmchilton
Member

jmchilton commented Nov 13, 2017

No reasons to prevent this - the create argument means "create if a history isn't available" not "force the creation of a history" as the author of this function must have thought when initially implemented. The work context always refers to a single history - so get_history has a very clear thing it should return and there should never be a reason to create a history.

Allow get_history calls with create=False when evaluation workflows.
No reasons to prevent this I guess - since create means create if a history isn't available not force the creation of a history.

@jmchilton jmchilton added this to the 18.01 milestone Nov 13, 2017

@jmchilton

This comment has been minimized.

Member

jmchilton commented Nov 13, 2017

The problematic stack trace:

galaxy.tools ERROR 2017-11-10 16:44:17,027 Exception caught while attempting tool execution:                                             
Traceback (most recent call last):                                  
  File "/galaxy/galaxy-app/lib/galaxy/tools/__init__.py", line 1311, in handle_single_execution                                          
    job, out_data = self.execute(trans, incoming=params, history=history, rerun_remap_job_id=rerun_remap_job_id, mapping_over_collection=mapping_over_collection, execution_cache=execution_cache)                                                                                 
  File "/galaxy/galaxy-app/lib/galaxy/tools/__init__.py", line 1391, in execute                                                          
    return self.tool_action.execute(self, trans, incoming=incoming, set_output_hid=set_output_hid, history=history, **kwargs)            
  File "/galaxy/galaxy-app/lib/galaxy/tools/actions/__init__.py", line 244, in execute                                                   
    (chrom_info, db_dataset) = app.genome_builds.get_chrom_info(input_dbkey, trans=trans, custom_build_hack_get_len_from_fasta_conversion=tool.id != 'CONVERTER_fasta_to_len')                                                                                                     
  File "/galaxy/galaxy-app/lib/galaxy/util/dbkeys.py", line 79, in get_chrom_info                                                        
    chrom_info = build_fasta_dataset.get_converted_dataset(trans, 'len').file_name                                                       
  File "/galaxy/galaxy-app/lib/galaxy/model/__init__.py", line 2158, in get_converted_dataset                                            
    new_dataset = next(iter(self.datatype.convert_dataset(trans, self, target_ext, return_output=True, visible=False, deps=deps, target_context=target_context, history=history).values()))                                                                                        
  File "/galaxy/galaxy-app/lib/galaxy/datatypes/data.py", line 612, in convert_dataset                                                   
    converted_dataset = converter.execute(trans, incoming=params, set_output_hid=visible, history=history)[1]                            
  File "/galaxy/galaxy-app/lib/galaxy/tools/__init__.py", line 1391, in execute                                                          
    return self.tool_action.execute(self, trans, incoming=incoming, set_output_hid=set_output_hid, history=history, **kwargs)            
  File "/galaxy/galaxy-app/lib/galaxy/tools/actions/__init__.py", line 209, in execute                                                   
    history, inp_data, inp_dataset_collections = self._collect_inputs(tool, trans, incoming, history, current_user_roles)                
  File "/galaxy/galaxy-app/lib/galaxy/tools/actions/__init__.py", line 186, in _collect_inputs                                           
    history = tool.get_default_history_by_trans(trans, create=True) 
  File "/galaxy/galaxy-app/lib/galaxy/tools/__init__.py", line 2023, in get_default_history_by_trans                                     
    return trans.get_history(create=create)                         
  File "/galaxy/galaxy-app/lib/galaxy/work/context.py", line 32, in get_history                                                          
    raise NotImplementedError("Cannot create histories from a work request context.")  
@lparsons

This comment has been minimized.

Contributor

lparsons commented Nov 13, 2017

This fixed a workflow execution bug for me: https://gist.github.com/lparsons/ac8456bb2fdb62ce51614c31e9baea12

👍

@mvdbeek

This comment has been minimized.

Member

mvdbeek commented Nov 16, 2017

If this argument doesn't do anything wouldn't it be clearer to drop it than to silently ignore it? (+1 anyway)

@jmchilton

This comment has been minimized.

Member

jmchilton commented Nov 16, 2017

@mvdbeek It does do something for other implementers of that interface (e.g. a traditional trans).

@mvdbeek mvdbeek merged commit 5dc2254 into galaxyproject:release_17.09 Nov 16, 2017

7 checks passed

api test Build finished. 292 tests run, 4 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 161 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 46 tests run, 0 skipped, 0 failed.
Details
lgtm analysis: JavaScript No alert changes
Details
selenium test Build finished. No test results found.
Details
toolshed test Build finished. 579 tests run, 0 skipped, 0 failed.
Details
@mvdbeek

This comment has been minimized.

Member

mvdbeek commented Nov 16, 2017

Thanks @jmchilton and @lparsons !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment