Skip to content

Commit cfddb3d

Browse files
author
Adriano Sanges
committed
Fix get_new_properties function to return new rows DataFrame
- Modify get_new_properties to return the DataFrame of new property rows - Ensure the function correctly returns the result of the LEFT JOIN query - Prepare for subsequent property insertion logic
1 parent 8bcad79 commit cfddb3d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

real-estate-etl/database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def get_new_properties(con: duckdb.DuckDBPyConnection) -> pl.DataFrame:
2828
LEFT JOIN main.properties p ON nd.url = p.url
2929
WHERE p.url IS NULL
3030
""").pl()
31+
return new_rows_df
3132

3233

3334
def insert_new_properties(con: duckdb.DuckDBPyConnection) -> None:

real-estate-etl/scan_properties.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
insert_new_properties(con)
3434

3535
# Iterate over the DataFrame and format each property
36-
if new_rows_df is not None:
36+
if new_rows_df is not None and not new_rows_df.is_empty():
3737
messages: list[str] = [format_property_message(row) for row in new_rows_df.iter_rows(named=True)]
3838
else:
3939
messages = []

0 commit comments

Comments
 (0)