Skip to content

Allow excluding date ranges from billing calculations#6

Open
QuanMPhm wants to merge 1 commit intoCCI-MOC:mainfrom
QuanMPhm:2/exclude_date_ranges
Open

Allow excluding date ranges from billing calculations#6
QuanMPhm wants to merge 1 commit intoCCI-MOC:mainfrom
QuanMPhm:2/exclude_date_ranges

Conversation

@QuanMPhm
Copy link
Collaborator

@QuanMPhm QuanMPhm commented Sep 3, 2025

Closes #2. More details in the commit message

Copy link
Collaborator

@naved001 naved001 left a comment

Choose a reason for hiding this comment

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

looks good, just some minor comments

@QuanMPhm QuanMPhm force-pushed the 2/exclude_date_ranges branch 2 times, most recently from 0380312 to e22732a Compare October 1, 2025 17:55
@QuanMPhm QuanMPhm requested a review from naved001 October 1, 2025 17:55
start_str, end_str = arg.split(",")
start_time, end_time = [parse_time_from_string(i) for i in (start_str, end_str)]
if start_time >= end_time:
raise ValueError(f"Start time {start_time} must be before end time {end_time}.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should raise an argparse.ArgumentTypeError here instead of ValueError. Otherwise, it actually won't print the message from ValueError.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting.

@QuanMPhm QuanMPhm force-pushed the 2/exclude_date_ranges branch from e22732a to 739107f Compare October 2, 2025 14:43
@QuanMPhm QuanMPhm requested a review from naved001 October 2, 2025 14:43
Excluded date ranges are specified as a list of start and end ISO timestamps.
Example: --excluded-time-ranges '2020-03-16T09:30:00,2020-03-16T10:30:00' '2020-03-18T00:00:00,2020-03-19T00:00:00'

All timestamps will be converted to UTC.
@QuanMPhm QuanMPhm force-pushed the 2/exclude_date_ranges branch from 739107f to 2cedee7 Compare October 2, 2025 14:46
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.

Allow excluding date ranges in billing

2 participants