checkpoint

This commit is contained in:
Moses Rolston 2025-03-09 13:07:53 -07:00
parent 97c96ed0fc
commit 084ddc26d3

View File

@ -33,6 +33,14 @@ def write_to_csv(legislation_data, csv_file):
flattened_legislation.append(flattened_item) flattened_legislation.append(flattened_item)
df = pd.DataFrame(flattened_legislation) df = pd.DataFrame(flattened_legislation)
# Debugging: Print the first few entries of the DataFrame to inspect its structure
print("Debugging DataFrame:")
if not df.empty:
print(df.head())
else:
print("DataFrame is empty.")
if df.empty: if df.empty:
neo4j_logger.warning(f"No data to write to CSV file: {csv_file}") neo4j_logger.warning(f"No data to write to CSV file: {csv_file}")
print("DataFrame is empty. Debugging information:") print("DataFrame is empty. Debugging information:")
@ -40,10 +48,6 @@ def write_to_csv(legislation_data, csv_file):
print(json.dumps(item, indent=4)) print(json.dumps(item, indent=4))
return return
# Debugging statement to check DataFrame contents
print("DataFrame contents:")
print(df.head())
df.to_csv(csv_file, index=False) df.to_csv(csv_file, index=False)
neo4j_logger.info(f"Data written to CSV file: {csv_file}") neo4j_logger.info(f"Data written to CSV file: {csv_file}")