Skip to content

Commit ac1b76f

Browse files
Apply suggestions from code review
Adding Co-pilots nit-pick suggestions.. they seem reasonable Co-authored-by: Copilot <[email protected]>
1 parent b5878be commit ac1b76f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

schema_automator/generalizers/csv_data_generalizer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,11 @@ def infer_range(slot: dict, vals: set, types: dict, coerce=True) -> str:
645645
if all(isfloat(v) for v in nn_vals):
646646
return 'float'
647647
if all(is_date(v) for v in nn_vals):
648-
if all(len(str(v).split('T')) == 1 for v in nn_vals): # Check if values are just dates without time
648+
if all(
649+
not hasattr(parse(str(v)), 'hour') or
650+
(parse(str(v)).hour == 0 and parse(str(v)).minute == 0 and parse(str(v)).second == 0)
651+
for v in nn_vals
652+
): # Check if values are just dates without time
649653
return 'date'
650654
return 'datetime'
651655
if is_all_measurement(nn_vals):

schema_automator/importers/rdfs_import_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def convert(
132132

133133
for slot in self.generate_rdfs_properties(g, cls_slots):
134134
if slot.name in sb.schema.slots:
135-
warnings.warn(f"Slot '{slot.name}' already exists in schema; skipping duplicate.")
135+
logging.warning(f"Slot '{slot.name}' already exists in schema; skipping duplicate.")
136136
else:
137137
sb.add_slot(slot)
138138
for cls in self.process_rdfs_classes(g, cls_slots):

0 commit comments

Comments
 (0)