From 3e0ff9dd9cc41e47c8afac1a9c05bf30b3b005f3 Mon Sep 17 00:00:00 2001 From: dutta-alankar Date: Sun, 28 Apr 2024 12:43:01 +0200 Subject: [PATCH 1/3] [ENH] server communication error code added --- astro_plasma/core/download_database.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/astro_plasma/core/download_database.py b/astro_plasma/core/download_database.py index c033446..ded291a 100644 --- a/astro_plasma/core/download_database.py +++ b/astro_plasma/core/download_database.py @@ -24,6 +24,8 @@ def fetch_list_from_url(link_list_url: str) -> List[str]: # print(link_list_url) response = requests.get(link_list_url, stream=True) + if response.status_code != 200: + sys.exit(f"Problem communicating with dataserver! (error code: {response.status_code}") # print(response) links = response.content.decode("utf-8").split("\n") return links @@ -33,6 +35,8 @@ def fetch_list_from_url(link_list_url: str) -> List[str]: def get_filename(url: str) -> str: try: with requests.get(url, stream=True) as req: + if req.status_code != 200: + sys.exit(f"Problem communicating with dataserver! (error code: {req.status_code}") if content_disposition := req.headers.get("Content-Disposition"): param, options = werkzeug.http.parse_options_header(content_disposition) if param == "attachment" and (filename := options.get("filename")): From d56a12328f6bfdeb2e972eb9c724af805828290d Mon Sep 17 00:00:00 2001 From: dutta-alankar Date: Sun, 28 Apr 2024 13:02:08 +0200 Subject: [PATCH 2/3] [ENH] unit test trigger only on PR --- .github/workflows/AstroPlasma.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/AstroPlasma.yml b/.github/workflows/AstroPlasma.yml index 84d9d32..a16bf78 100644 --- a/.github/workflows/AstroPlasma.yml +++ b/.github/workflows/AstroPlasma.yml @@ -1,9 +1,10 @@ name: AstroPlasma Unit tests on: + workflow_dispatch: pull_request: - push: - branches: '**' + # push: + # branches: '**' jobs: python-env: From ab071e8b8d025ce593482bc2dd53c4ddb4c62d1a Mon Sep 17 00:00:00 2001 From: dutta-alankar Date: Sun, 28 Apr 2024 13:36:53 +0200 Subject: [PATCH 3/3] [ENH] unit test trigger only on PR --- .github/workflows/AstroPlasma.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/AstroPlasma.yml b/.github/workflows/AstroPlasma.yml index a16bf78..e9f4a21 100644 --- a/.github/workflows/AstroPlasma.yml +++ b/.github/workflows/AstroPlasma.yml @@ -3,8 +3,8 @@ name: AstroPlasma Unit tests on: workflow_dispatch: pull_request: - # push: - # branches: '**' + push: + branches: [main] jobs: python-env: