Hotfix using datetime.now().strftime() to format the time on spreadsheet_swarm.py #700
+138
−42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix DateTime Handling, File Saving, and Add Test for SpreadsheetSwarm
Problem
While pushing the Docker image, issues were discovered in the
spreadsheet_swarm.py
file related to datetime imports and formatting. The file-saving mechanism similarly caused runtime issues. Furthermore, the SpreadsheetSwarm was stopping the deployment of the API frommain.py
, leading to operational disruptions.An intermediate fix was applied to remove the
save_to_csv
function fromspreadsheet_swarm.py
to allow for deployment, but this fix was not optimal. The root cause has been addressed, and the functionality was reintroduced with an added test to ensure stability moving forward.Changes Made
1. Fix DateTime Handling in spreadsheet_swarm.py
run
method inspreadsheet_swarm.py
was modified to use the correct timestamp format (ISO 8601) for both swarm run and task logs2. Fix File Saving
3. Test File for spreadsheet_swarm.py
A new test file (
test_spread.py
) was created to verify the core functionality of the SpreadsheetSwarm component. The test file includes:4. Fix to main.py
run_server
function ofmain.py
, which was previously preventing the deployment of the APIFiles Changed
spreadsheet_swarm.py
save_to_csv
functionalitytest_spreadsheet_swarm.py
Added to verify the core functionality of SpreadsheetSwarm:
main.py
run_server
function to enable proper deployment of the APITesting
Unit Tests
The test file
test_spread.py
was added to verify the changes made tospreadsheet_swarm.py
. The following aspects of the SpreadsheetSwarm were tested:Test Environment
Moving forward, all features and bug fixes will undergo improved quality assurance. This will involve:
Conclusion
This pull request addresses the issues with datetime handling, file saving, and swarm metadata storage. The SpreadsheetSwarm was reintroduced with full functionality, including CSV saving, JSON export, and agent data logging, all of which were validated with a comprehensive unit test. The syntax error in
main.py
was also fixed, allowing for the smooth deployment of the API.The change implemented further improves the reliability of swarms to its adopters, customers, and the community.
Maintainers:
@kyegomez
@jmikedupont2
X:
@patrickbdevaney
📚 Documentation preview 📚: https://swarms--700.org.readthedocs.build/en/700/