mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 12:41:02 +02:00
Structured data loader CLI
This commit is contained in:
parent
6c0e10a84f
commit
eb2b7194c2
1 changed files with 4 additions and 2 deletions
|
|
@ -441,7 +441,8 @@ def load_structured_data(
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
logger.warning(f"Failed to convert '{value}' to float in record {record_num}")
|
logger.warning(f"Failed to convert '{value}' to float in record {record_num}")
|
||||||
|
|
||||||
processed_record[target_field] = value
|
# Convert all values to strings as required by ExtractedObject schema
|
||||||
|
processed_record[target_field] = str(value) if value is not None else ""
|
||||||
else:
|
else:
|
||||||
logger.warning(f"Source field '{source_field}' not found in record {record_num}")
|
logger.warning(f"Source field '{source_field}' not found in record {record_num}")
|
||||||
|
|
||||||
|
|
@ -776,7 +777,8 @@ def load_structured_data(
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
logger.warning(f"Failed to convert '{value}' to float in record {record_num}")
|
logger.warning(f"Failed to convert '{value}' to float in record {record_num}")
|
||||||
|
|
||||||
processed_record[target_field] = value
|
# Convert all values to strings as required by ExtractedObject schema
|
||||||
|
processed_record[target_field] = str(value) if value is not None else ""
|
||||||
else:
|
else:
|
||||||
logger.warning(f"Source field '{source_field}' not found in record {record_num}")
|
logger.warning(f"Source field '{source_field}' not found in record {record_num}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue