Skip to content

Commit

Permalink
feat: add profile json to parsing warehouse (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdellahitech authored Feb 15, 2024
1 parent 477c3f0 commit 51f1920
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 87 deletions.
172 changes: 86 additions & 86 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand All @@ -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))


Expand Down Expand Up @@ -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))


Expand Down
19 changes: 18 additions & 1 deletion src/hrflow_connectors/connectors/hrflow/warehouse/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down Expand Up @@ -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"],
Expand Down

0 comments on commit 51f1920

Please sign in to comment.