Skip to content

Commit 84f06b9

Browse files
Update database operations
1 parent af907f5 commit 84f06b9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

database-operations/create_table.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Configure logging
77
logging.basicConfig(
8-
filename='log/create_table.log',
8+
filename='logs/create_table.log',
99
level=logging.INFO,
1010
format='%(asctime)s - %(levelname)s - %(message)s',
1111
)
@@ -26,7 +26,6 @@ def create_products_table():
2626
CREATE TABLE products (
2727
id VARCHAR(50),
2828
name VARCHAR(255),
29-
description TEXT,
3029
original_price NUMERIC(10, 2),
3130
price NUMERIC(10, 2),
3231
fulfillment_type VARCHAR(50),
@@ -36,7 +35,6 @@ def create_products_table():
3635
favourite_count INTEGER,
3736
current_seller VARCHAR(255),
3837
number_of_images INTEGER,
39-
has_video BOOLEAN,
4038
category VARCHAR(100),
4139
quantity_sold INTEGER,
4240
discount NUMERIC(5, 2)

database-operations/insert_table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# Configure logging
99
logging.basicConfig(
10-
filename='insert_db.log',
10+
filename='logs/insert_and_stream.log',
1111
level=logging.INFO,
1212
format='%(asctime)s - %(levelname)s - %(message)s'
1313
)
@@ -56,7 +56,7 @@ def insert_table(data_file, table_name, num_rows):
5656
logging.info("Query executed successfully.")
5757
except Exception as e:
5858
logging.error(f"Failed to execute query with error: {e}")
59-
sleep(3)
59+
sleep(4)
6060

6161
if __name__ == "__main__":
6262
insert_table(DATA_FILE, TABLE_NAME, NUM_ROWS)

0 commit comments

Comments
 (0)