Skip to content

HARMONY-1997: As a harmony-py user I would like to see a warning message when a job results in no data.#108

Merged
ygliuvt merged 3 commits into
mainfrom
harmony-1997
Mar 4, 2025
Merged

HARMONY-1997: As a harmony-py user I would like to see a warning message when a job results in no data.#108
ygliuvt merged 3 commits into
mainfrom
harmony-1997

Conversation

@ygliuvt

@ygliuvt ygliuvt commented Mar 4, 2025

Copy link
Copy Markdown
Member

Jira Issue ID

HARMONY-1997

Description

Updated harmony-py to report error when there is no files to download for failed or warning requests during client.download_all invocation.

Local Test Steps

Since we have to use customized (fake) service image to get requests into warning state, it doesn't make sense to add a notebook to demonstrate this behavior. Also the current failed request notebook is returning success probably due to recent configuration changes which we will have to fix as a separate issue (HARMONY-2034).

Here is a notebook snippet to test the error reporting for warning request. I will restore the faked service-example image in UAT once this PR is merged.

import helper
helper.install_project_and_dependencies('..', libs=['examples'])
import json
import sys
import datetime as dt
from harmony import BBox, Client, Collection, Request, Environment

harmony_client = Client(env=Environment.UAT)

collection = Collection(id='C1233800302-EEDTEST')

request = Request(
    collection=collection,
    spatial=BBox(-140, 20, -50, 60),
    granule_id='G1233800343-EEDTEST',
    crs='EPSG:31975',
    variables=['blue_var'],
    format='image/png'
)

job_id = harmony_client.submit(request)

for filename in [f.result() for f in harmony_client.download_all(job_id)]:
    print(f'\nDownload file: {filename}')

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)

@chris-durbin chris-durbin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully.

Comment thread harmony/client.py Outdated
@ygliuvt ygliuvt merged commit 7338d79 into main Mar 4, 2025
@ygliuvt ygliuvt deleted the harmony-1997 branch March 4, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants