From 51f19204af51af6d8d2ea83e1edd46005f1eb4a8 Mon Sep 17 00:00:00 2001 From: Abdellahi Mezid <135601200+Abdellahitech@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:06:32 +0100 Subject: [PATCH] feat: add profile json to parsing warehouse (#223) --- CHANGELOG.md | 172 +++++++++--------- .../connectors/hrflow/warehouse/profile.py | 19 +- 2 files changed, 104 insertions(+), 87 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61381cc63..dc878cc9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,54 +8,54 @@ * feat: consider info if exists rather than the parsed info (#221) -* feat: consider info if exists rather than the parsed info - -* fix: add case urls in info of profile json - -* fix: after jamal review - -* fix: remplace cv url by cv binary (#220) - -* fix:add some error handling for jobology connector - -* fix:jobology flake8 connector - -* fix:some type - -* fix:regarding jamal review - -* fix: remplace cv url by cv binary - -* docs: update docs - -* fix: flake8 outputs - -* fix: jobology catch profile - -* docs: update docs - -* fix: regarding jamal review - -* fix: handle possible error binasciii - -* fix: flake8 and docs - -* fix: some flake8 output - -* fix: correct update date for Jobology connector (#222) - -Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> - -* 4.6.1 - -Automatically generated by python-semantic-release - -* fix: regarding jamal review location=value - ---------- - -Co-authored-by: the-forest-tree <65894619+the-forest-tree@users.noreply.github.com> -Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> +* feat: consider info if exists rather than the parsed info + +* fix: add case urls in info of profile json + +* fix: after jamal review + +* fix: remplace cv url by cv binary (#220) + +* fix:add some error handling for jobology connector + +* fix:jobology flake8 connector + +* fix:some type + +* fix:regarding jamal review + +* fix: remplace cv url by cv binary + +* docs: update docs + +* fix: flake8 outputs + +* fix: jobology catch profile + +* docs: update docs + +* fix: regarding jamal review + +* fix: handle possible error binasciii + +* fix: flake8 and docs + +* fix: some flake8 output + +* fix: correct update date for Jobology connector (#222) + +Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> + +* 4.6.1 + +Automatically generated by python-semantic-release + +* fix: regarding jamal review location=value + +--------- + +Co-authored-by: the-forest-tree <65894619+the-forest-tree@users.noreply.github.com> +Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> Co-authored-by: hrflow-semantic-release <hrflow-semantic-release> ([`5b7997b`](https://github.com/Riminder/hrflow-connectors/commit/5b7997b5080b31de96d074b001369150ac95f596)) @@ -69,30 +69,30 @@ Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> ([`852c6aa`](h * fix: remplace cv url by cv binary (#220) -* fix:add some error handling for jobology connector - -* fix:jobology flake8 connector - -* fix:some type - -* fix:regarding jamal review - -* fix: remplace cv url by cv binary - -* docs: update docs - -* fix: flake8 outputs - -* fix: jobology catch profile - -* docs: update docs - -* fix: regarding jamal review - -* fix: handle possible error binasciii - -* fix: flake8 and docs - +* fix:add some error handling for jobology connector + +* fix:jobology flake8 connector + +* fix:some type + +* fix:regarding jamal review + +* fix: remplace cv url by cv binary + +* docs: update docs + +* fix: flake8 outputs + +* fix: jobology catch profile + +* docs: update docs + +* fix: regarding jamal review + +* fix: handle possible error binasciii + +* fix: flake8 and docs + * fix: some flake8 output ([`b41676e`](https://github.com/Riminder/hrflow-connectors/commit/b41676ebab149f4dd1170b34f7baf3641792981a)) @@ -275,20 +275,20 @@ rule of releasing depending on commit messages ([`16844d9`](https://github.com/R * Adding new actions 'pull_application_list' and 'push_score_list'. (#184) -* Adding new actions 'pull_application_list' and 'push_score_list'. They will be used to sync applications (profiles, jobs, statuses) and synchronize scores from HrFlow.ai to a target warehouse - -* style: apply black formatting - -* test: add new pull_application_list to coherence tests - -* fix: use random key for backend test to avoid failure in ci -It seems that when running multiple ci run in the same time -race condition can occur and one test can find the result of another -running in the same time - ---------- - -Co-authored-by: thomas <thomas.zhu@hrflow.ai> +* Adding new actions 'pull_application_list' and 'push_score_list'. They will be used to sync applications (profiles, jobs, statuses) and synchronize scores from HrFlow.ai to a target warehouse + +* style: apply black formatting + +* test: add new pull_application_list to coherence tests + +* fix: use random key for backend test to avoid failure in ci +It seems that when running multiple ci run in the same time +race condition can occur and one test can find the result of another +running in the same time + +--------- + +Co-authored-by: thomas <thomas.zhu@hrflow.ai> Co-authored-by: the-forest-tree <the-forest-tree@hrflow.ai> ([`df7d387`](https://github.com/Riminder/hrflow-connectors/commit/df7d3874bee3bf9d991f2d45b991330684ff6c0f)) diff --git a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py index 636db472d..a6ff6a405 100644 --- a/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py +++ b/src/hrflow_connectors/connectors/hrflow/warehouse/profile.py @@ -208,7 +208,8 @@ def write_parsing( api_secret=parameters.api_secret, api_user=parameters.api_user ) for profile in profiles: - profile_info = profile.pop("info", {}) + profile_info = profile.get("info", {}) + if parameters.only_insert and hrflow_client.profile.indexing.get( source_key=parameters.source_key, reference=profile["reference"] ).get("data"): @@ -248,6 +249,22 @@ def write_parsing( elif source_response["data"]["sync_parsing"] is True: current_profile = parsing_response["data"]["profile"] profile_result = merge_info(current_profile, profile_info) + + profile_result["text"] = profile.get("text") or profile_result.get("text") + profile_result["text_language"] = profile.get( + "text_language" + ) or profile_result.get("text_language") + profile_result["experiences_duration"] = ( + profile.get("experiences_duration") + if profile.get("experiences_duration") is not None + else profile_result.get("experiences_duration") + ) + profile_result["educations_duration"] = ( + profile.get("educations_duration") + if profile.get("educations_duration") is not None + else profile_result.get("educations_duration") + ) + edit_response = hrflow_client.profile.indexing.edit( source_key=parameters.source_key, key=profile_result["key"],