Removed deprecated warning

This commit is contained in:
Kevin Veen-Birkenbach 2023-12-25 23:39:28 +01:00
parent bcc8a7fb00
commit de59646fc0
1 changed files with 5 additions and 3 deletions

View File

@ -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)