brynq-sdk-bob 2.8.2.dev0__py3-none-any.whl → 2.8.4__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 CHANGED
@@ -52,30 +52,21 @@ class People:
52
52
  df.columns = df.columns.str.replace('/', '.', regex=False)
53
53
 
54
54
 
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
55
+ # Clean up custom .value columns; keeps only one field per custom key. the .value column actually contains the value., other column is nested key.
58
56
  custom_cols = [col for col in df.columns if "custom" in str(col) and str(col).endswith('.value')]
59
57
  for col in custom_cols:
60
58
  new_col = col.removesuffix('.value')
61
- # If the new column doesn't exist, rename it directly
59
+ # prefer non-empty clean column, otherwise upgrade .value data
62
60
  if new_col not in df.columns:
63
61
  df = df.rename(columns={col: new_col})
64
- # If it exists but is all empty/NA, and the .value column has data, overwrite it
65
62
  elif df[new_col].isna().all() and not df[col].isna().all():
66
63
  df[new_col] = df[col]
67
64
  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
69
65
  else:
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
66
+ # Drop identical/redundant .value col
72
67
  if df[new_col].equals(df[col]):
73
68
  df = df.drop(columns=[col])
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
69
+ pass
79
70
 
80
71
 
81
72
  # 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.
brynq_sdk_bob/reports.py CHANGED
@@ -25,13 +25,13 @@ class Reports:
25
25
 
26
26
  return df
27
27
 
28
- def download(self, report_id: int | str = None) -> bytes:
28
+ def download(self, report_id: int | str = None, report_format: str = "csv") -> bytes:
29
29
  if report_id:
30
30
  url = f"{self.bob.base_url}company/reports/{report_id}/download"
31
31
  else:
32
32
  raise ValueError("Either report_id or report_name must be provided")
33
33
 
34
- resp = self.bob.session.get(url=url, timeout=self.bob.timeout, params={"format": "csv"})
34
+ resp = self.bob.session.get(url=url, timeout=self.bob.timeout, params={"format": report_format})
35
35
  resp.raise_for_status()
36
36
  data = resp.content
37
37
 
@@ -26,7 +26,7 @@ class PeopleSchema(BrynQPanderaDataFrameModel):
26
26
  first_name: Optional[Series[String]] = pa.Field(coerce=True, nullable=True, description="First Name", alias="firstName", metadata={"api_field": "root.firstName"})
27
27
  full_name: Optional[Series[String]] = pa.Field(coerce=True, nullable=True, description="Full Name", alias="fullName", metadata={"api_field": "root.fullName"})
28
28
  # the date is in DD/MM/YYYY format,
29
- personal_birth_date: Optional[Series[DateTime]] = pa.Field(coerce=True, nullable=False, description="Personal Birth Date", alias="personal.birthDate")
29
+ personal_birth_date: Optional[Series[DateTime]] = pa.Field(coerce=True, nullable=True, description="Personal Birth Date", alias="personal.birthDate")
30
30
  personal_pronouns: Optional[Series[String]] = pa.Field(coerce=True, nullable=True, description="Personal Pronouns", alias="personal.pronouns")
31
31
  personal_honorific: Optional[Series[String]] = pa.Field(coerce=True, nullable=True, description="Personal Honorific", alias="personal.honorific")
32
32
  personal_nationality: Optional[Series[object]] = pa.Field(coerce=True, check_name=check_list, description="Personal Nationality", alias="personal.nationality")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brynq_sdk_bob
3
- Version: 2.8.2.dev0
3
+ Version: 2.8.4
4
4
  Summary: Bob wrapper from BrynQ
5
5
  Author: BrynQ
6
6
  Author-email: support@brynq.com
@@ -7,8 +7,8 @@ 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=2vgut_HnlwzWI6-yzdeQrPRQSz5YBNsD0_QqVtwrXPs,6810
11
- brynq_sdk_bob/reports.py,sha256=fiYzd6037siGl6c4KQLE7F4CeFRRDVDgSIVcWVVWsvI,1209
10
+ brynq_sdk_bob/people.py,sha256=t1A1dABX6UZ0pyLTGOL-Sp5pHY630KWIyIO3JQ_Pjdk,5970
11
+ brynq_sdk_bob/reports.py,sha256=Tawmqm_ZmQ487loyk-29-A_fTCrgImbWCEf6zfwuaq4,1245
12
12
  brynq_sdk_bob/salaries.py,sha256=BGQm-PT9QuKKJ9DP5nX6wmC8SZRAlm9M9I2EJhoZaII,1523
13
13
  brynq_sdk_bob/timeoff.py,sha256=NbBZ39qy9D7jbS_z9bpmB-BKNuUGmNrkYTbEw034tZ0,3339
14
14
  brynq_sdk_bob/work.py,sha256=0bVZkQ0I6z-z2_ql-EsOpFExx8VgsJvpcCQdOfiJYQM,712
@@ -19,11 +19,11 @@ brynq_sdk_bob/schemas/employment.py,sha256=KUGbT8hjYuQIN-3BGlIrBBswXT6fSPkLtn5bl
19
19
  brynq_sdk_bob/schemas/named_lists.py,sha256=HJBRKrAI2vhrkq-5MVXqQcmpGNzFtoOnaZI2Ii_6_vs,725
20
20
  brynq_sdk_bob/schemas/payments.py,sha256=LrSr8WApYxqbMDmhYmh0EISEbWJinWovsULZV6sItG0,4290
21
21
  brynq_sdk_bob/schemas/payroll_history.py,sha256=JdAq0XaArHHEw8EsXo3GD0EhSAyBhPtYQMmdvjCiY8g,806
22
- brynq_sdk_bob/schemas/people.py,sha256=Zs58mO4i8M-u-DLWRS0IHbyDNiwrhxSxOX8t3mLr2fw,40150
22
+ brynq_sdk_bob/schemas/people.py,sha256=42BJVgJmT-h5kzuQl6iI7wZDSGNA0KTQQVIAqeeyHNk,40149
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.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,,
26
+ brynq_sdk_bob-2.8.4.dist-info/METADATA,sha256=i8xKzW4Se01HsfeIOHSe_uHIxGVpornQ0Elqhdz0kHE,371
27
+ brynq_sdk_bob-2.8.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
+ brynq_sdk_bob-2.8.4.dist-info/top_level.txt,sha256=oGiWqOuAAiVoLIzGe6F-Lo4IJBYz5ftOwBft7HtPuoY,14
29
+ brynq_sdk_bob-2.8.4.dist-info/RECORD,,