From de59646fc0c923f379c1d1d0c3d3a5a2876b83ac Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 25 Dec 2023 23:39:28 +0100 Subject: [PATCH] Removed deprecated warning --- database_entry_seeder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/database_entry_seeder.py b/database_entry_seeder.py index 7199101..93613b7 100644 --- a/database_entry_seeder.py +++ b/database_entry_seeder.py @@ -19,9 +19,11 @@ def check_and_add_entry(file_path, host, database, username, password): else: print("Adding new entry.") - # Add (or replace) the entry - new_entry = {'host': host, 'database': database, 'username': username, 'password': password} - df = df.append(new_entry, ignore_index=True) + # Create a new DataFrame for the new entry + new_entry = pd.DataFrame([{'host': host, 'database': database, 'username': username, 'password': password}]) + + # Add (or replace) the entry using concat + df = pd.concat([df, new_entry], ignore_index=True) # Save the updated CSV file df.to_csv(file_path, sep=';', index=False)