-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storing report in the DB instead of writing to file (#675)
* Storing report in the DB instead of writing to file * Fixes before PR review * typo * Update prediction_market_agent/agents/microchain_agent/nft_treasury_game/scripts/generate_report.py Co-authored-by: Peter Jung <peter@jung.ninja> * Update prediction_market_agent/agents/microchain_agent/nft_treasury_game/scripts/generate_report.py Co-authored-by: Peter Jung <peter@jung.ninja> * Update prediction_market_agent/agents/microchain_agent/nft_treasury_game/scripts/generate_report.py Co-authored-by: Peter Jung <peter@jung.ninja> * Implemented PR comments --------- Co-authored-by: Peter Jung <peter@jung.ninja>
- Loading branch information
1 parent
ad7f254
commit aeff41e
Showing
4 changed files
with
91 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from prediction_market_agent.db.models import ReportNFTGame | ||
from prediction_market_agent.db.sql_handler import SQLHandler | ||
|
||
|
||
class ReportNFTGameTableHandler: | ||
def __init__( | ||
self, | ||
sqlalchemy_db_url: str | None = None, | ||
): | ||
self.sql_handler = SQLHandler( | ||
model=ReportNFTGame, sqlalchemy_db_url=sqlalchemy_db_url | ||
) | ||
|
||
def save_report(self, report: ReportNFTGame) -> None: | ||
"""Save item to storage.""" | ||
self.sql_handler.save_multiple([report]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters