Skip to content

Commit

Permalink
Merge branch 'master' into preserve-args-redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
burnout87 authored Jul 17, 2023
2 parents 9ffe00e + bcae281 commit 0ca0be5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 997 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
pip install flake8 pytest mypy pylint pytest-cov pytest-xdist wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .[test,ontology]
curl -o tests/oda-ontology.ttl https://raw.githubusercontent.com/oda-hub/ontology/ecdf2a61f87aac13ae7a96c0f3dad960312adae4/ontology.ttl
- name: Lint with flake8
if: ${{ env.TEST_ONLY_FAST != 'true' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/python-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
pip install -r plugin-test-req.txt;
fi
pip install -e ./plugin[test]
curl -o tests/oda-ontology.ttl https://raw.githubusercontent.com/oda-hub/ontology/ecdf2a61f87aac13ae7a96c0f3dad960312adae4/ontology.ttl
- name: Test ${{ matrix.plugin-name }} plugin with pytest
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ data/dummy_prods**
.venv
js9.fits
test-dispatcher-conf-with-gallery.yaml
tests/oda-ontology.ttl
3 changes: 2 additions & 1 deletion cdci_data_analysis/analysis/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
'job_id',
'async_dispatcher',
'allow_unknown_args',
'catalog_selected_objects']
'catalog_selected_objects',
'run_asynch']
# NOTE: arguments are passed in the request to the dispatcher
# some arguments are used to set the values of the analysis parameters
# the parameter is a subclass of Parameter and may use several arguments to set it's value
Expand Down
25 changes: 12 additions & 13 deletions cdci_data_analysis/analysis/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,25 +529,24 @@ def get_query_products(self,instrument,job,run_asynch,query_type='Real',logger=N

query_out = QueryOutput()
#status=0
message=''
debug_message=''

messages = {}
messages['message']=''
messages['debug_message']=''
msg_str = '--> start get product query',query_type
# print(msg_str)
logger.info(msg_str)
backend_comment=''
backend_warning=''
messages['comment']=''
messages['warning']=''
try:
if query_type != 'Dummy':
q = self.get_data_server_query(instrument,config)

res, data_server_query_out = q.run_query(call_back_url=job.get_call_back_url(), run_asynch=run_asynch, logger=logger)

if 'comment' in data_server_query_out.status_dictionary.keys():
backend_comment=data_server_query_out.status_dictionary['comment']

if 'warning' in data_server_query_out.status_dictionary.keys():
backend_warning=data_server_query_out.status_dictionary['warning']

for field in ['message', 'debug_message', 'comment', 'warning']:
if field in data_server_query_out.status_dictionary.keys():
messages[field]=data_server_query_out.status_dictionary[field]

status = data_server_query_out.get_status()
job_status = data_server_query_out.get_job_status()
Expand All @@ -574,7 +573,7 @@ def get_query_products(self,instrument,job,run_asynch,query_type='Real',logger=N

job.set_done()
#DONE
query_out.set_done(message=message, debug_message=str(debug_message),job_status=job.status,status=status,comment=backend_comment,warning=backend_warning)
query_out.set_done(message=messages['message'], debug_message=str(messages['debug_message']),job_status=job.status,status=status,comment=messages['comment'],warning=messages['warning'])
#print('-->', query_out.status_dictionary)
except RequestNotUnderstood as e:
logger.error("passing request issue: %s", e)
Expand All @@ -592,14 +591,14 @@ def get_query_products(self,instrument,job,run_asynch,query_type='Real',logger=N
raise

e_message = getattr(e, 'message', '')
debug_message = repr(e) + ' : ' + getattr(e, 'debug_message', '')
messages['debug_message'] = repr(e) + ' : ' + getattr(e, 'debug_message', '')

query_out.set_failed('get_dataserver_products found job failed',
logger=logger,
sentry_dsn=sentry_dsn,
excep=e,
e_message=e_message,
debug_message=debug_message)
debug_message=messages['debug_message'])
# TODO to use this approach when we will refactor the handling of exceptions
# raise InternalError(e_message)

Expand Down
Loading

0 comments on commit 0ca0be5

Please sign in to comment.