Spaces:
Sleeping
Sleeping
marintosti12 commited on
Commit ·
1310d90
1
Parent(s): d0a05b4
fix (linter) : fix linter if
Browse files
src/models/employee_dataset.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import sqlalchemy as sa
|
| 2 |
-
from datetime import datetime
|
| 3 |
from sqlalchemy.orm import Mapped, mapped_column
|
| 4 |
from sqlalchemy import BigInteger, Integer, String, DateTime
|
| 5 |
from .base import Base
|
|
|
|
| 1 |
import sqlalchemy as sa
|
| 2 |
+
from datetime import datetime
|
| 3 |
from sqlalchemy.orm import Mapped, mapped_column
|
| 4 |
from sqlalchemy import BigInteger, Integer, String, DateTime
|
| 5 |
from .base import Base
|
src/seeds/employee_dataset_seed.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
-
import os
|
|
|
|
|
|
|
| 2 |
from sqlalchemy import create_engine, text
|
| 3 |
from sqlalchemy.orm import Session
|
| 4 |
|
|
@@ -19,14 +21,18 @@ YES = {"oui", "y", "true", "1"}
|
|
| 19 |
NO = {"non", "n", "false", "0"}
|
| 20 |
|
| 21 |
def map_bool_to_int(v: str | None):
|
| 22 |
-
if v is None:
|
|
|
|
| 23 |
s = str(v).strip().lower()
|
| 24 |
-
if s in YES:
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
return None
|
| 27 |
|
| 28 |
def map_percent_to_int(v: str | None):
|
| 29 |
-
if not v:
|
|
|
|
| 30 |
m = re.search(r"-?\d+", str(v))
|
| 31 |
return int(m.group(0)) if m else None
|
| 32 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import csv
|
| 3 |
+
import re
|
| 4 |
from sqlalchemy import create_engine, text
|
| 5 |
from sqlalchemy.orm import Session
|
| 6 |
|
|
|
|
| 21 |
NO = {"non", "n", "false", "0"}
|
| 22 |
|
| 23 |
def map_bool_to_int(v: str | None):
|
| 24 |
+
if v is None:
|
| 25 |
+
return None
|
| 26 |
s = str(v).strip().lower()
|
| 27 |
+
if s in YES:
|
| 28 |
+
return 1
|
| 29 |
+
if s in NO:
|
| 30 |
+
return 0
|
| 31 |
return None
|
| 32 |
|
| 33 |
def map_percent_to_int(v: str | None):
|
| 34 |
+
if not v:
|
| 35 |
+
return None
|
| 36 |
m = re.search(r"-?\d+", str(v))
|
| 37 |
return int(m.group(0)) if m else None
|
| 38 |
|