omop-lite 0.0.17__tar.gz → 0.0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {omop_lite-0.0.17 → omop_lite-0.0.18}/PKG-INFO +1 -1
  2. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/db/sqlserver.py +9 -4
  3. {omop_lite-0.0.17 → omop_lite-0.0.18}/pyproject.toml +1 -1
  4. {omop_lite-0.0.17 → omop_lite-0.0.18}/.gitignore +0 -0
  5. {omop_lite-0.0.17 → omop_lite-0.0.18}/LICENSE +0 -0
  6. {omop_lite-0.0.17 → omop_lite-0.0.18}/README.md +0 -0
  7. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/__init__.py +0 -0
  8. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/db/__init__.py +0 -0
  9. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/db/base.py +0 -0
  10. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/db/postgres.py +0 -0
  11. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/fts.sql +0 -0
  12. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/mssql/constraints.sql +0 -0
  13. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/mssql/ddl.sql +0 -0
  14. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/mssql/indices.sql +0 -0
  15. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/mssql/primary_keys.sql +0 -0
  16. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/pg/constraints.sql +0 -0
  17. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/pg/ddl.sql +0 -0
  18. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/pg/fts_index.sql +0 -0
  19. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/pg/indices.sql +0 -0
  20. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/scripts/pg/primary_keys.sql +0 -0
  21. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/settings.py +0 -0
  22. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/CDM_SOURCE.csv +0 -0
  23. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/CONCEPT.csv +0 -0
  24. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/CONCEPT_ANCESTOR.csv +0 -0
  25. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/CONCEPT_CLASS.csv +0 -0
  26. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/CONCEPT_RELATIONSHIP.csv +0 -0
  27. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/CONCEPT_SYNONYM.csv +0 -0
  28. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/CONDITION_OCCURRENCE.csv +0 -0
  29. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/DOMAIN.csv +0 -0
  30. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/DRUG_STRENGTH.csv +0 -0
  31. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/MEASUREMENT.csv +0 -0
  32. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/OBSERVATION.csv +0 -0
  33. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/PERSON.csv +0 -0
  34. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/RELATIONSHIP.csv +0 -0
  35. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/100/VOCABULARY.csv +0 -0
  36. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/CONCEPT.csv +0 -0
  37. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/CONDITION_ERA.csv +0 -0
  38. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/CONDITION_OCCURRENCE.csv +0 -0
  39. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/DRUG_ERA.csv +0 -0
  40. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/DRUG_EXPOSURE.csv +0 -0
  41. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/MEASUREMENT.csv +0 -0
  42. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/OBSERVATION.csv +0 -0
  43. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/OBSERVATION_PERIOD.csv +0 -0
  44. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/PERSON.csv +0 -0
  45. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/PROCEDURE_OCCURRENCE.csv +0 -0
  46. {omop_lite-0.0.17 → omop_lite-0.0.18}/omop_lite/synthetic/1000/VISIT_OCCURRENCE.csv +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omop-lite
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary: Get an OMOP CDM database running quickly.
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.13
@@ -37,7 +37,7 @@ class SQLServerDatabase(Database):
37
37
  with open(str(file_path), "r", encoding="utf-8", newline="") as f:
38
38
  reader = csv.reader(f, delimiter=delimiter)
39
39
  headers = next(reader)
40
-
40
+
41
41
  columns = ", ".join(f"[{col}]" for col in headers)
42
42
  placeholders = ", ".join(["?" for _ in headers])
43
43
  insert_sql = f"INSERT INTO {settings.schema_name}.[{table_name}] ({columns}) VALUES ({placeholders})"
@@ -46,9 +46,14 @@ class SQLServerDatabase(Database):
46
46
  try:
47
47
  cursor = conn.cursor()
48
48
  for line_no, row in enumerate(reader, start=2):
49
- if len(row) != len(headers):
50
- print(f"Row {line_no} skipped: expected {len(headers)} values, got {len(row)} – {row}")
51
- continue
49
+ # Pad short rows
50
+ if len(row) < len(headers):
51
+ row += [None] * (len(headers) - len(row))
52
+ logger.info(f"Row {line_no} padded: {row}")
53
+ elif len(row) > len(headers):
54
+ logger.info(f"Row {line_no} trimmed: too many values ({len(row)}), expected {len(headers)} – trimming.")
55
+ row = row[:len(headers)]
56
+
52
57
  cursor.execute(insert_sql, row)
53
58
  conn.commit()
54
59
  finally:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "omop-lite"
3
- version = "0.0.17"
3
+ version = "0.0.18"
4
4
  description = "Get an OMOP CDM database running quickly."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
File without changes
File without changes
File without changes