Skip to content

Commit

Permalink
Add Updated Title Roles to Autocomplete (#165)
Browse files Browse the repository at this point in the history
* add support for utr in autocomplete

* update test

* lint
  • Loading branch information
vvillait88 authored Dec 17, 2024
1 parent 8f6fdbf commit de0ee85
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 13 deletions.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 = "peopledatalabs"
version = "4.1.5"
version = "4.2.0"
description = "Official Python client for the People Data Labs API"
homepage = "https://www.peopledatalabs.com"
repository = "https://github.com/peopledatalabs/peopledatalabs-python"
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
annotated-types==0.7.0 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53 \
--hash=sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89
certifi==2024.8.30 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \
--hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9
certifi==2024.12.14 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56 \
--hash=sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db
charset-normalizer==3.4.0 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621 \
--hash=sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6 \
Expand Down
6 changes: 3 additions & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ black==24.8.0 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c \
--hash=sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920 \
--hash=sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1
certifi==2024.8.30 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \
--hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9
certifi==2024.12.14 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56 \
--hash=sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db
charset-normalizer==3.4.0 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621 \
--hash=sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6 \
Expand Down
2 changes: 1 addition & 1 deletion src/peopledatalabs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from .main import PDLPY


__version__ = "4.1.5"
__version__ = "4.2.0"

__all__ = ["PDLPY"]
2 changes: 2 additions & 0 deletions src/peopledatalabs/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class FieldEnum(str, Enum):
Valid values for 'field' parameter of autocomplete API.
"""

class_ = "class"
company = "company"
country = "country"
industry = "industry"
Expand All @@ -99,6 +100,7 @@ class AutocompleteModel(BaseRequestModel):
text: Optional[str]
pretty: Optional[bool]
titlecase: Optional[bool]
updated_title_roles: Optional[bool]


class SkillModel(BaseRequestModel):
Expand Down
15 changes: 15 additions & 0 deletions tests/client/test_autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,18 @@ def test_api_endpoint_autocomplete(client):
)
assert isinstance(completion, requests.Response)
assert completion.status_code == 200


@pytest.mark.usefixtures("client")
def test_api_endpoint_autocomplete_with_class(client):
"""
Tests successful execution of autocomplete API with class field.
"""
completion = client.autocomplete(
field="class",
text="sales",
size=20,
updated_title_roles=True,
)
assert isinstance(completion, requests.Response)
assert completion.status_code == 200
2 changes: 1 addition & 1 deletion tests/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_version():
"""
Version check.
"""
assert __version__ == "4.1.5"
assert __version__ == "4.2.0"


@pytest.mark.usefixtures("fake_api_key")
Expand Down

0 comments on commit de0ee85

Please sign in to comment.