From 3865b46fe6e982f42495a884293cb04cbdc7078b Mon Sep 17 00:00:00 2001 From: Venkat Tarakad Date: Fri, 6 Dec 2024 21:10:15 -0500 Subject: [PATCH] Fix datetime import. fix initialize_market_setup function bug --- mongo_setup.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mongo_setup.py b/mongo_setup.py index 14a69fd..dd596bd 100644 --- a/mongo_setup.py +++ b/mongo_setup.py @@ -1,7 +1,7 @@ from config import API_KEY, API_SECRET, POLYGON_API_KEY, RANK_POLYGON_API_KEY, MONGO_DB_USER, MONGO_DB_PASS, mongo_url from helper_files.client_helper import strategies from pymongo import MongoClient -import datetime +from datetime import datetime import math def insert_rank_to_coefficient(i): @@ -77,11 +77,11 @@ def initialize_time_delta(): client.close() def initialize_market_setup(): - client = MongoClient(mongo_url) - db = client.market_data - collection = client.market_status - collection.insert_one({"market_status": "closed"}) - client.close() + client = MongoClient(mongo_url) + db = client.market_data # Access the market_data database + collection = db.market_status # Access the market_status collection + collection.insert_one({"market_status": "closed"}) + client.close() if __name__ == "__main__": insert_rank_to_coefficient(100)