Skip to content

Commit

Permalink
Add check for empty dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
paulf81 committed Jun 2, 2023
1 parent 55f0663 commit 2ce8858
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flasc/raw_data_handling/sqldatabase_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ def send_data(
# Check for times already in database
df_ = self._remove_duplicated_time(table_name, df_)

# Check if df_ is now
if df_.shape[0] == 0:
print('Dataframe is empty')
return

# Write to database
print(f'Inserting {df_.shape[0]} rows into {table_name} in chunks of {df_chunk_size}')
time_start_total = timerpc()
Expand Down

0 comments on commit 2ce8858

Please sign in to comment.