Skip to content

Add babs init --shared-group <GROUP>#368

Merged
tien-tong merged 4 commits into
mainfrom
add-git-shared-group
Apr 21, 2026
Merged

Add babs init --shared-group <GROUP>#368
tien-tong merged 4 commits into
mainfrom
add-git-shared-group

Conversation

@tien-tong

@tien-tong tien-tong commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

PR

  1. Add babs init --shared-group <GROUP>

  2. Also patch this edge case:

babs submit intentionally writes job_submit.csv once before submission with only pre-submit columns (sub_id, task_id), then rewrites it with job_id after sbatch.

If submit is interrupted between those two writes, later calls read an intermediate job_submit.csv that has no job_id, and get_latest_submitted_jobs_df() crashes with error like this:

Traceback (most recent call last):
  File "/ceph/projects/sattertt/pennlinc-parcc/software/miniforge3/envs/babs/bin/babs", line 6, in <module>
    sys.exit(_main())
             ^^^^^^^
  File "/ceph/projects/sattertt/pennlinc-parcc/software/babs/babs/cli.py", line 766, in _main
    options.func(**args)
  File "/ceph/projects/sattertt/pennlinc-parcc/software/babs/babs/cli.py", line 434, in babs_submit_main
    babs_proj.babs_submit(
  File "/ceph/projects/sattertt/pennlinc-parcc/software/babs/babs/interaction.py", line 36, in babs_submit
    currently_running_df = self.get_currently_running_jobs_df()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ceph/projects/sattertt/pennlinc-parcc/software/babs/babs/base.py", line 486, in get_currently_running_jobs_df
    last_submitted_jobs_df = self.get_latest_submitted_jobs_df()
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ceph/projects/sattertt/pennlinc-parcc/software/babs/babs/base.py", line 451, in get_latest_submitted_jobs_df
    df[column_name] = df[column_name].astype(status_dtypes[column_name])
                      ~~^^^^^^^^^^^^^
  File "/ceph/projects/sattertt/pennlinc-parcc/software/miniforge3/envs/babs/lib/python3.11/site-packages/pandas/core/frame.py", line 4378, in __getitem__
    indexer = self.columns.get_loc(key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ceph/projects/sattertt/pennlinc-parcc/software/miniforge3/envs/babs/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3648, in get_loc
    raise KeyError(key) from err
KeyError: 'job_id'

--->

  • Kept get_currently_running_jobs_df() behavior the same as before, no change in babs status
  • Added a defensive fix in get_latest_submitted_jobs_df() so if job_submit.csv is missing job_id (interrupted pre-submit write), it no longer crashes with KeyError.

@tien-tong tien-tong added the enhancement New feature or request label Apr 15, 2026
@codecov-commenter

codecov-commenter commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.85%. Comparing base (912ef8a) to head (5ac47ec).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
babs/base.py 60.71% 20 Missing and 13 partials ⚠️
babs/bootstrap.py 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #368      +/-   ##
==========================================
- Coverage   79.55%   78.85%   -0.70%     
==========================================
  Files          17       17              
  Lines        1956     2048      +92     
  Branches      331      357      +26     
==========================================
+ Hits         1556     1615      +59     
- Misses        279      299      +20     
- Partials      121      134      +13     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread babs/cli.py
Comment thread tests/test_base.py Outdated
@tien-tong tien-tong added the bug Issues noting problems and PRs fixing those problems. label Apr 20, 2026
@tien-tong tien-tong merged commit 55e9dd0 into main Apr 21, 2026
10 checks passed
@tien-tong tien-tong deleted the add-git-shared-group branch April 21, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues noting problems and PRs fixing those problems. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants