Skip to content

Commit

Permalink
Merge branches 'feature/add-connector-subtype' and 'feature/add-conne…
Browse files Browse the repository at this point in the history
…ctor-subtype' of github.com:Riminder/hrflow-connectors into feature/add-connector-subtype
  • Loading branch information
thomas committed Sep 2, 2024
2 parents ee8f09b + 35c7365 commit b06bfcc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@



## v4.20.1 (2024-09-02)

### Fix

* fix: update usage of Hrflow python SDK to match 3.3.0 ([`8e1c4e8`](https://github.com/Riminder/hrflow-connectors/commit/8e1c4e8ca579321d7905c5d8e6b585df2f6efbff))


## v4.20.0 (2024-08-30)

### Documentation
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hrflow-connectors"
version = "4.20.0"
version = "4.20.1"
description = "hrflow-connectors is an open source project created by HrFlow.ai to allow developers to connect easily HR ecosystem component."
license = "Apache-2.0"
authors = ["HrFlow.ai <support+hrflow_connectors@hrflow.ai>"]
Expand Down
18 changes: 9 additions & 9 deletions src/hrflow_connectors/connectors/hrflow/warehouse/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def enrich_job_with_parsing(hrflow_client: Hrflow, job: t.Dict) -> None:
if cleaned == "":
return

response = hrflow_client.document.parsing.post(text=cleaned)
response = hrflow_client.text.parsing.post(texts=[cleaned])
if response["code"] >= 400:
raise JobParsingException("Failed to parse job", client_response=response)

entities, parsed_text = response["data"]["entities"], response["data"]["text"]
entities, parsed_text = response["data"][0]["entities"], response["data"][0]["text"]
for field in ["skills", "languages", "certifications", "courses", "tasks"]:
if job.get(field) is None:
job[field] = []
Expand Down Expand Up @@ -170,7 +170,7 @@ def write(
)
)
for reference in references_to_archive:
response = hrflow_client.job.indexing.archive(
response = hrflow_client.job.storing.archive(
board_key=parameters.board_key, reference=reference, is_archive=1
)
if response["code"] >= 400:
Expand All @@ -197,7 +197,7 @@ def write(
)
failed_jobs.append(job)
continue
response = hrflow_client.job.indexing.add_json(
response = hrflow_client.job.storing.add_json(
board_key=parameters.board_key, job_json=job
)
if response["code"] >= 400:
Expand All @@ -208,7 +208,7 @@ def write(
failed_jobs.append(job)
continue

response = hrflow_client.job.indexing.get(
response = hrflow_client.job.storing.get(
board_key=parameters.board_key, reference=reference
)
if "Unable to find object: job" in response["message"]:
Expand All @@ -225,7 +225,7 @@ def write(
)
failed_jobs.append(job)
continue
response = hrflow_client.job.indexing.add_json(
response = hrflow_client.job.storing.add_json(
board_key=parameters.board_key, job_json=job
)
if response["code"] >= 400:
Expand All @@ -241,7 +241,7 @@ def write(
job_key = response["data"]["key"]
if archived_at is None:
if parameters.update_content:
response = hrflow_client.job.indexing.edit(
response = hrflow_client.job.storing.edit(
board_key=parameters.board_key, key=job_key, job_json=job
)
if response["code"] >= 400:
Expand All @@ -254,7 +254,7 @@ def write(
failed_jobs.append(job)
continue
else:
response = hrflow_client.job.indexing.archive(
response = hrflow_client.job.storing.archive(
board_key=parameters.board_key, reference=reference, is_archive=0
)
if response["code"] >= 400:
Expand All @@ -266,7 +266,7 @@ def write(
)
failed_jobs.append(job)
continue
response = hrflow_client.job.indexing.edit(
response = hrflow_client.job.storing.edit(
board_key=parameters.board_key, key=job_key, job_json=job
)
if response["code"] >= 400:
Expand Down
14 changes: 7 additions & 7 deletions src/hrflow_connectors/connectors/hrflow/warehouse/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def read(
hrflow_client = Hrflow(
api_secret=parameters.api_secret, api_user=parameters.api_user
)
response = hrflow_client.profile.indexing.get(
response = hrflow_client.profile.storing.get(
source_key=parameters.source_key, key=parameters.profile_key
)
if "Unable to find object" in response["message"]:
Expand Down Expand Up @@ -133,7 +133,7 @@ def write(
)
for profile in profiles:
if parameters.edit:
current_profile = hrflow_client.profile.indexing.get(
current_profile = hrflow_client.profile.storing.get(
source_key=parameters.source_key, reference=profile["reference"]
).get("data")
if not current_profile:
Expand All @@ -151,7 +151,7 @@ def write(
edit = profile
profile_to_index = {**current_profile, **edit}

response = hrflow_client.profile.indexing.edit(
response = hrflow_client.profile.storing.edit(
source_key=parameters.source_key,
key=current_profile["key"],
profile_json=profile_to_index,
Expand All @@ -165,7 +165,7 @@ def write(
)
failed.append(profile)
else:
response = hrflow_client.profile.indexing.add_json(
response = hrflow_client.profile.storing.add_json(
source_key=parameters.source_key, profile_json=profile
)
if response["code"] // 100 != 2:
Expand Down Expand Up @@ -251,7 +251,7 @@ def write_parsing(
source_response = hrflow_client.source.get(key=parameters.source_key)

for profile in profiles:
if parameters.only_insert and hrflow_client.profile.indexing.get(
if parameters.only_insert and hrflow_client.profile.storing.get(
source_key=parameters.source_key, reference=profile["reference"]
).get("data"):
adapter.info(
Expand All @@ -261,7 +261,7 @@ def write_parsing(
continue

if profile.get("resume") is None:
indexing_response = hrflow_client.profile.indexing.add_json(
indexing_response = hrflow_client.profile.storing.add_json(
source_key=parameters.source_key, profile_json=profile
)
if indexing_response["code"] != 201:
Expand Down Expand Up @@ -303,7 +303,7 @@ def write_parsing(
current_profile = parsing_response["data"]["profile"]
profile_result = hydrate_profile(current_profile, profile)

edit_response = hrflow_client.profile.indexing.edit(
edit_response = hrflow_client.profile.storing.edit(
source_key=parameters.source_key,
key=profile_result["key"],
profile_json=profile_result,
Expand Down

0 comments on commit b06bfcc

Please sign in to comment.