Skip to content
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

Stop catching generic Exception in operators #100

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

tatiana
Copy link
Collaborator

@tatiana tatiana commented Nov 28, 2024

By catching Exception, we risk hitting an unexpected exception that the program can't recover from, or worse, swallowing an important exception without properly logging it - a massive headache when trying to debug programs that are failing in weird ways.

If this change raises any exceptions that should be caught, we'll have the opportunity to understand which exceptions to capture and handle them gracefully.

As part of this PR, I also refactored the tests associated with operators. They were inconsistently applying mock, which led to hiding some underlining issues. There is a bigger problem with the tests in that they validate the implementation and not the actual behaviour, but I have not changed this.

This was identified during the #81 development.

By catching Exception, we risk hitting an unexpected exception that the program can't recover from, or worse, swallowing an important exception without properly logging it - a massive headache when trying to debug programs that are failing in weird ways.

If this change leads to any exceptions that should be caught being raised, we'll have the opportunity to understand which are those exceptions and capture them, handling them in a graceful way.

This was identified during #81 development.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.14%. Comparing base (6e69368) to head (2ed23e3).

Files with missing lines Patch % Lines
ray_provider/operators.py 96.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
+ Coverage   97.74%   98.14%   +0.40%     
==========================================
  Files           6        7       +1     
  Lines         576      593      +17     
==========================================
+ Hits          563      582      +19     
+ Misses         13       11       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ray_provider/operators.py Show resolved Hide resolved
ray_provider/operators.py Show resolved Hide resolved
@tatiana tatiana mentioned this pull request Nov 29, 2024
3 tasks
@tatiana tatiana added this to the Astro Ray Provider 0.3.0 milestone Nov 29, 2024
@tatiana tatiana merged commit fadce49 into main Nov 29, 2024
22 checks passed
@tatiana tatiana mentioned this pull request Nov 29, 2024
tatiana added a commit that referenced this pull request Nov 29, 2024
**Breaking changes**

* Removal of ``SubmitRayJob.terminal_states``. The same values are now available at ``ray_provider.constants.TERMINAL_JOB_STATUSES``.
* Simplify the project structure and debugging by @tatiana in #93

In order to improve the development and troubleshooting DAGs created with this provider, we introduced breaking changes
to the folder structure. It was flattened and the import paths to existing decorators, hooks, operators and trigger
changed, as documented in the table below:
  | Type      | Previous import path                        | Current import path                     |
  |-----------|---------------------------------------------|-----------------------------------------|
  | Decorator | ray_provider.decorators.ray.ray             | ray_provider.decorators.ray             |
  | Hook      | ray_provider.hooks.ray.RayHook              | ray_provider.hooks.RayHook              |
  | Operator  | ray_provider.operators.ray.DeleteRayCluster | ray_provider.operators.DeleteRayCluster |
  | Operator  | ray_provider.operators.ray.SetupRayCluster  | ray_provider.operators.SetupRayCluster  |
  | Operator  | ray_provider.operators.ray.SubmitRayJob     | ray_provider.operators.SubmitRayJob     |
  | Trigger   | ray_provider.triggers.ray.RayJobTrigger     | ray_provider.triggers.RayJobTrigger     |


**Features**

* Support using callable ``config`` in ``@ray.task`` by @tatiana in #103
* Support running Ray jobs indefinitely without timing out by @venkatajagannath and @tatiana in #74

**Bug fixes**

* Fix integration test and bug in load balancer wait logic by @pankajastro in #85
* Bugfix: Better exception handling and cluster clean up by @venkatajagannath in #68
* Stop catching generic ``Exception`` in operators by @tatiana in #100
* Stop catching generic ``Exception`` in trigger by @tatiana in #99

**Docs**

* Add docs to deploy project on Astro Cloud by @pankajastro in #90
* Fix dead reference in docs index page by @pankajastro in #87
* Cloud Auth documentation update by @venkatajagannath in #58
* Improve main docs page by @TJaniF in #71

**Others**

Local development

* Fix the local development environment and update documentation by @tatiana in #92
* Enable secret detection precommit check by @pankajastro in #91
* Add astro cli project + kind Raycluster setup instruction by @pankajastro in #83
* Remove pytest durations from tests by @tatiana in #102
* Fix running make docker-run when there is a new version by @tatiana in #99 and #101
* Improve Astro CLI DAGs test so running hatch test-cov locally doesn't fail by @tatiana in #97

CI

* CI improvement by @venkatajagannath in #73
* CI fix related to broken coverage upload artifact by @pankajkoti in #60
* Allow tests to run for PRs from forked repos by @venkatajagannath in #72
* Update CODEOWNERS by @tatiana in #84
* Add Airflow 2.10 (released in August 2024) to tests by @tatiana in #96
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