aws-samples / aws-samples/hpc-cost-simulator

[BUG] JobAnalyzer.py exception when --starttime is specified without --endtime

Open
#122 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14
Forks
5
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

```
../../hpc-cost-simulator/JobAnalyzer.py --config config.yml --acknowledge-config --output-dir output/analyzer --disable-version-check --starttime '2025-09-01T00:00:00' csv --input-csv output/jobs.csv
```

```
ERROR:2025-10-17 02:41:58,627: Unhandled exception
Traceback (most recent call last):
File "/home/scratch.acarter_gpu/lsf-logs/nv_pdx_hw_pod01/../../hpc-cost-simulator/JobAnalyzer.py", line 1461, in main
jobAnalyzer.analyze_jobs()
File "/home/scratch.acarter_gpu/lsf-logs/nv_pdx_hw_pod01/../../hpc-cost-simulator/JobAnalyzer.py", line 1254, in analyze_jobs
self._process_hourly_jobs()
File "/home/scratch.acarter_gpu/lsf-logs/nv_pdx_hw_pod01/../../hpc-cost-simulator/JobAnalyzer.py", line 253, in _process_hourly_jobs
self._update_hourly_stats(round_hour, instance_minutes, runtime_minutes, core_hours, total_hourly_rate, spot_eligible, instance_family)
File "/home/scratch.acarter_gpu/lsf-logs/nv_pdx_hw_pod01/../../hpc-cost-simulator/JobAnalyzer.py", line 134, in _update_hourly_stats
logger.debug(f" endtime hour={int(self._endtime_dt.timestamp() / SECONDS_PER_HOUR)} timestamp={self._endtime_dt.timestamp()} {self._endtime_dt}")
AttributeError: 'NoneType' object has no attribute 'timestamp'
```

**To Reproduce**

```
../../hpc-cost-simulator/JobAnalyzer.py --config config.yml --acknowledge-config --output-dir output/analyzer --disable-version-check --starttime '2025-09-01T00:00:00' csv --input-csv output/jobs.csv
``

**Expected behavior**
Remove the debug statement for endtime unless it is specified.

Contributor guide

Open the contributing guide

Research direction

Start with JobAnalyzer.py line 134 in _update_hourly_stats and reproduce the issue with the shown command using --starttime without --endtime. Done means analysis completes without the NoneType timestamp exception and the endtime debug output is absent when no end time is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, data
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.