Skip to content

Conversation

@harinlee83
Copy link
Contributor

Reproducing the bug with the following query:

Analyze the latest 8-K for Apple for me

The analyze_8k tool call in its current form fails with the error

{
  "success": false,
  "error": "Failed to analyze 8-K: 'str' object has no attribute 'isoformat'"
}

This is because the edgartools package returns the date_of_report property as a string. So it needs to parsed back into a datetime object with datetime.strptime before converting to the desired isoformat.

The tool will also subsequently fail with this error at a later step

{
  "success": false,
  "error": "Failed to analyze 8-K: 'PressRelease' object is not iterable"
}

Again this depends on the implementation of the PressReleases class in edgartools but a quick fix was to wrap it with list(). Also noticed that PressRelease does not have a title property or attribute so I removed that.

With these proposed changes, the analyze_8k tool call works as expected.

@stefanoamorelli
Copy link
Owner

Thanks a lot for the contribution @harinlee83, LGTM ✔️

There's a failing linting issue, could you please have a look before merging?

@stefanoamorelli stefanoamorelli self-requested a review August 17, 2025 10:52
Copy link
Owner

@stefanoamorelli stefanoamorelli left a comment

Choose a reason for hiding this comment

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

LGTM - just make sure to run the linter before merging.

@stefanoamorelli stefanoamorelli merged commit 2a60364 into stefanoamorelli:main Aug 17, 2025
11 checks passed
stefanoamorelli added a commit that referenced this pull request Aug 17, 2025
Includes:
- Bug fix for 8-K date_of_report parsing (PR #28)
- Bug fix for press_releases iteration
- Documentation: Added Contributors section with badges
- Code formatting improvements
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.

2 participants