diff --git a/src/treg/catalog/adapters.yaml b/src/treg/catalog/adapters.yaml index fb226942..a35f8f3f 100644 --- a/src/treg/catalog/adapters.yaml +++ b/src/treg/catalog/adapters.yaml @@ -2771,7 +2771,7 @@ adapters: out: {full_name: "join(firstName, lastName)", first_name: firstName, last_name: lastName, headline: title, location: location, followers: followerCount, connections: connectionsCount, about: description, linkedin_url: url} - miss: "id == null" + miss: "coalesce(firstName, lastName) == null" fetchinio.linkedin.company.profile: accepts: [[linkedin_url], [linkedin_handle]] in: {linkedin_url: queryParams.companyUrlOrUrn, linkedin_handle: queryParams.companyUrlOrUrn} diff --git a/tests/test_routing.py b/tests/test_routing.py index 2ba727b0..dcdb137b 100644 --- a/tests/test_routing.py +++ b/tests/test_routing.py @@ -196,6 +196,10 @@ def test_fetchin_linkedin_adapters_are_verified_and_routed(): assert "fetchinio.linkedin.user.reactions" not in cat.adapters assert "fetchinio.linkedin.post.engagement" not in cat.adapters + profile = cat.adapters["fetchinio.linkedin.user.profile"] + assert profile.is_miss({"id": "profile-id", "firstName": None, "lastName": None}) + assert not profile.is_miss({"id": "profile-id", "firstName": "Ada", "lastName": None}) + async def test_fetchin_member_posts_route_uses_adapter_and_settles( clients: AsyncClient, platform_on, monkeypatch,