Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions watson/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ def report(watson, current, from_, to, projects, tags, ignore_projects,
luna=luna, all=all,
include_partial_frames=include_partial_frames)

# Handle None output_format (Python 3.13+ compatibility)
if output_format is None:
output_format = 'plain'

if 'json' in output_format and not aggregated:
click.echo(json.dumps(report, indent=4, sort_keys=True,
default=json_arrow_encoder))
Expand Down Expand Up @@ -872,11 +876,18 @@ def aggregate(ctx, watson, current, from_, to, projects, tags, output_format,
delta = (to - from_).days
lines = []

# Handle None output_format (Python 3.13+ compatibility)
if output_format is None:
output_format = 'plain'

for i in range(delta + 1):
offset = datetime.timedelta(days=i)
from_offset = from_ + offset
output = ctx.invoke(report, current=current, from_=from_offset,
to=from_offset, projects=projects, tags=tags,
ignore_projects=(), ignore_tags=(),
year=None, month=None, week=None, day=None,
luna=None, all=None,
output_format=output_format,
pager=pager, aggregated=True,
include_partial_frames=True)
Expand Down Expand Up @@ -1069,6 +1080,10 @@ def log(watson, current, reverse, from_, to, projects, tags, ignore_projects,
ignore_tags=ignore_tags or None, span=span
)

# Handle None output_format (Python 3.13+ compatibility)
if output_format is None:
output_format = 'plain'

if 'json' in output_format:
click.echo(frames_to_json(filtered_frames))
return
Expand Down