- 
                Notifications
    
You must be signed in to change notification settings  - Fork 32
 
          🐛Director-v2: fix empty arguments for max method
          #8308
        
          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
  
    🐛Director-v2: fix empty arguments for max method
  
  #8308
              Conversation
          
 | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
        
          
                services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/_scheduler_base.py
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where the max function could be called with an empty array, which would result in a ValueError. The issue was introduced in PR #8286 where the code structure allowed for a scenario where tasks_waiting_for_cluster could be empty when passed to the max function.
- Adds early return checks to prevent calling 
maxon an empty list - Restructures the conditional logic to handle edge cases more robustly
 
          Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@             Coverage Diff             @@
##           master    #8308       +/-   ##
===========================================
- Coverage   85.62%   68.82%   -16.80%     
===========================================
  Files        1940      755     -1185     
  Lines       75322    34792    -40530     
  Branches     1311      175     -1136     
===========================================
- Hits        64491    23945    -40546     
- Misses      10436    10790      +354     
+ Partials      395       57      -338     
 
 Continue to review full report in Codecov by Sentry. 
 🚀 New features to boost your workflow:
  | 
    
          
🧪 CI InsightsHere's what we observed from your CI run for 09927da. 🟢 All jobs passed!But CI Insights is watching 👀  | 
    



What do these changes do?
#8286 introduced an issue where a call to

maxcould be made with an empty array:This PR fixes it.
Related issue/s
How to test
Dev-ops