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

custom base exceptions updated for pickling #2669

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mbordash2
Copy link
Contributor

@mbordash2 mbordash2 commented Nov 20, 2024

Summary

Why This Is Needed

Implement exception pickling to prevent TypeErrors as reported in issue #2405

What Changed

Fixed

Runway custom exceptions pickling implemented.

Checklist

  • Have you followed the guidelines in our Contribution Requirements?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Does your submission pass tests?
  • Have you linted your code locally prior to submission?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@mbordash2 mbordash2 self-assigned this Nov 20, 2024
@github-actions github-actions bot added bug Something isn't working changelog:patch Patch change resulting in a patch release labels Nov 20, 2024
@mbordash2 mbordash2 added changelog:skip Don't include this pull request in the release change log and removed bug Something isn't working changelog:patch Patch change resulting in a patch release labels Nov 20, 2024
@github-actions github-actions bot added bug Something isn't working changelog:patch Patch change resulting in a patch release labels Nov 20, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 5 lines in your changes missing coverage. Please review.

Project coverage is 90.18%. Comparing base (58f8b72) to head (d0994b5).

Files with missing lines Patch % Lines
runway/exceptions.py 90.90% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2669      +/-   ##
==========================================
- Coverage   90.20%   90.18%   -0.02%     
==========================================
  Files         256      256              
  Lines       15691    15711      +20     
==========================================
+ Hits        14154    14169      +15     
- Misses       1537     1542       +5     

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


🚨 Try these New Features:

@ITProKyle ITProKyle removed the changelog:skip Don't include this pull request in the release change log label Nov 21, 2024
Comment on lines +108 to +115
self.exit_code = (
response.get("StatusCode", 1) if response else 1
) # we can assume this will be > 0
error: dict[Any, Any] | None = (
response.get("Error") if response else {}
) # value from dict could be NoneType
if error:
self.message = error.get("Message", "error message undefined")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be done without changing the signature by storing the response on the object.

Suggested change
self.exit_code = (
response.get("StatusCode", 1) if response else 1
) # we can assume this will be > 0
error: dict[Any, Any] | None = (
response.get("Error") if response else {}
) # value from dict could be NoneType
if error:
self.message = error.get("Message", "error message undefined")
self._response = response
self.exit_code = response.get("StatusCode", 1) # we can assume this will be > 0
error: dict[Any, Any] = response.get("Error") or {} # value from dict could be NoneType
self.message = error.get("Message", "error message undefined")

Then, the __reduce__ method would return self.class, (self._response,)

@ITProKyle ITProKyle added this to the v2.8.0 milestone Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog:patch Patch change resulting in a patch release
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[BUG] Fix exception pickling (cause of TypeError => BrokenProcessPool).
2 participants