diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d19611c..080c1cc90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 630f1ec80..def9cfd34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] diff --git a/src/hrflow_connectors/connectors/hrflow/warehouse/job.py b/src/hrflow_connectors/connectors/hrflow/warehouse/job.py index 17cb27966..4b2567e60 100644 --- a/src/hrflow_connectors/connectors/hrflow/warehouse/job.py +++ b/src/hrflow_connectors/connectors/hrflow/warehouse/job.py @@ -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] = [] @@ -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: @@ -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: @@ -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"]: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py index d6baaba46..60b47ec54 100644 --- a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py +++ b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py @@ -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"]: @@ -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: @@ -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, @@ -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: @@ -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( @@ -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: @@ -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,