brynq-sdk-bob 2.8.2__py3-none-any.whl → 2.8.2.dev0__py3-none-any.whl
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.
- brynq_sdk_bob/people.py +13 -4
- {brynq_sdk_bob-2.8.2.dist-info → brynq_sdk_bob-2.8.2.dev0.dist-info}/METADATA +1 -1
- {brynq_sdk_bob-2.8.2.dist-info → brynq_sdk_bob-2.8.2.dev0.dist-info}/RECORD +5 -5
- {brynq_sdk_bob-2.8.2.dist-info → brynq_sdk_bob-2.8.2.dev0.dist-info}/WHEEL +0 -0
- {brynq_sdk_bob-2.8.2.dist-info → brynq_sdk_bob-2.8.2.dev0.dist-info}/top_level.txt +0 -0
brynq_sdk_bob/people.py
CHANGED
|
@@ -52,21 +52,30 @@ class People:
|
|
|
52
52
|
df.columns = df.columns.str.replace('/', '.', regex=False)
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
#
|
|
55
|
+
# Format custom columns in the same way as they were in the schema/request body.
|
|
56
|
+
# (e.g. 'identification.custom.field_1747318003716.value' -> 'identification.custom.field_1747318003716')
|
|
57
|
+
# But only if the target column doesn't already exist or is empty, to prioritize the cleaner name if it has value
|
|
56
58
|
custom_cols = [col for col in df.columns if "custom" in str(col) and str(col).endswith('.value')]
|
|
57
59
|
for col in custom_cols:
|
|
58
60
|
new_col = col.removesuffix('.value')
|
|
59
|
-
#
|
|
61
|
+
# If the new column doesn't exist, rename it directly
|
|
60
62
|
if new_col not in df.columns:
|
|
61
63
|
df = df.rename(columns={col: new_col})
|
|
64
|
+
# If it exists but is all empty/NA, and the .value column has data, overwrite it
|
|
62
65
|
elif df[new_col].isna().all() and not df[col].isna().all():
|
|
63
66
|
df[new_col] = df[col]
|
|
64
67
|
df = df.drop(columns=[col])
|
|
68
|
+
# If both exist and have data, prefer the existing one (assuming cleaner format) but drop the .value duplicate if redundant
|
|
65
69
|
else:
|
|
66
|
-
#
|
|
70
|
+
# If both exist, we might want to keep the existing one as is, and just drop the .value one to avoid confusion
|
|
71
|
+
# Or check if they are identical and drop one
|
|
67
72
|
if df[new_col].equals(df[col]):
|
|
68
73
|
df = df.drop(columns=[col])
|
|
69
|
-
|
|
74
|
+
else:
|
|
75
|
+
# If they differ, we might want to keep the one with more data or default to existing behavior
|
|
76
|
+
# For now, let's assume we trust the existing column if it has data.
|
|
77
|
+
# Just drop the .value column if we aren't using it to overwrite
|
|
78
|
+
pass
|
|
70
79
|
|
|
71
80
|
|
|
72
81
|
# A lot of fields from Bob are returned with only ID's. Those fields should be mapped to names. Therefore, we need to get the mapping from the named-lists endpoint.
|
|
@@ -7,7 +7,7 @@ brynq_sdk_bob/employment.py,sha256=uNllQrIBbo8yPG_2-ln1PWeWUFU672T289PpWWvL-V8,7
|
|
|
7
7
|
brynq_sdk_bob/named_lists.py,sha256=ksLXV2ysBFegq4gZiiaC56gjkgdnPzL7WajZTGvjYIM,1069
|
|
8
8
|
brynq_sdk_bob/payments.py,sha256=HVXoMyA0Jyhyk5EcgCU2OQfdbMtElhdLfdBKgI9xC4Q,3922
|
|
9
9
|
brynq_sdk_bob/payroll_history.py,sha256=wHo6da7kLDe1ViL4egyMdyJBMZnWVhwjNjmh4cTCTeY,3972
|
|
10
|
-
brynq_sdk_bob/people.py,sha256=
|
|
10
|
+
brynq_sdk_bob/people.py,sha256=2vgut_HnlwzWI6-yzdeQrPRQSz5YBNsD0_QqVtwrXPs,6810
|
|
11
11
|
brynq_sdk_bob/reports.py,sha256=fiYzd6037siGl6c4KQLE7F4CeFRRDVDgSIVcWVVWsvI,1209
|
|
12
12
|
brynq_sdk_bob/salaries.py,sha256=BGQm-PT9QuKKJ9DP5nX6wmC8SZRAlm9M9I2EJhoZaII,1523
|
|
13
13
|
brynq_sdk_bob/timeoff.py,sha256=NbBZ39qy9D7jbS_z9bpmB-BKNuUGmNrkYTbEw034tZ0,3339
|
|
@@ -23,7 +23,7 @@ brynq_sdk_bob/schemas/people.py,sha256=Zs58mO4i8M-u-DLWRS0IHbyDNiwrhxSxOX8t3mLr2
|
|
|
23
23
|
brynq_sdk_bob/schemas/salary.py,sha256=TSaM1g92y3oiDcUrfJW7ushgKZenI9xB6XW3kKuU0dE,4540
|
|
24
24
|
brynq_sdk_bob/schemas/timeoff.py,sha256=uswH42djiiWE2H0wXKHoneDvOJQ5BlaIeNdNl-kYd-s,4117
|
|
25
25
|
brynq_sdk_bob/schemas/work.py,sha256=YgtBJ0WXJOq55bFlT_kY_IbHh0SlQEtaa0W8vms-xA4,3048
|
|
26
|
-
brynq_sdk_bob-2.8.2.dist-info/METADATA,sha256=
|
|
27
|
-
brynq_sdk_bob-2.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
-
brynq_sdk_bob-2.8.2.dist-info/top_level.txt,sha256=oGiWqOuAAiVoLIzGe6F-Lo4IJBYz5ftOwBft7HtPuoY,14
|
|
29
|
-
brynq_sdk_bob-2.8.2.dist-info/RECORD,,
|
|
26
|
+
brynq_sdk_bob-2.8.2.dev0.dist-info/METADATA,sha256=XOtNxJvNDOa2913ueNfR132HeYHuBvEk92K4GhZJr_I,376
|
|
27
|
+
brynq_sdk_bob-2.8.2.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
brynq_sdk_bob-2.8.2.dev0.dist-info/top_level.txt,sha256=oGiWqOuAAiVoLIzGe6F-Lo4IJBYz5ftOwBft7HtPuoY,14
|
|
29
|
+
brynq_sdk_bob-2.8.2.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|