Embed a role again when its text arrives, and keep the place its own page gave
A role listed before its page was read kept a title-only vector, and the listing's place replaced the page's on every later pull. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
fd89381caa
commit
31abad4c8e
5 files changed
+69
-6
No files matched your search
@@ -549,6 +549,24 @@ def test_upsert_twice_keeps_first_seen_and_bumps_last_seen(
|
||||
("acme", "senior backend engineer", "berlin")
|
||||
|
||||
|
||||
def test_a_vector_made_without_the_text_goes_when_the_text_arrives(store: Store) -> None:
|
||||
listed = posting()
|
||||
listed.body = ""
|
||||
store.upsert_role(listed)
|
||||
store.put_vectors("m", [(listed.uid, np.ones(4, dtype=np.float32))])
|
||||
assert store.roles_to_embed("m", 10) == []
|
||||
|
||||
store.upsert_role(listed) # listed again, still without text
|
||||
assert store.roles_to_embed("m", 10) == []
|
||||
store.upsert_role(posting()) # the role's own page was read
|
||||
assert [r.uid for r in store.roles_to_embed("m", 10)] == [listed.uid]
|
||||
|
||||
store.put_vectors("m", [(listed.uid, np.ones(4, dtype=np.float32))])
|
||||
store.upsert_role(listed) # later pulls send no text
|
||||
store.upsert_role(posting()) # or the same text again
|
||||
assert store.roles_to_embed("m", 10) == []
|
||||
|
||||
|
||||
def test_upsert_unpacks_raw_and_keeps_filled_columns(store: Store) -> None:
|
||||
store.upsert_role(posting(place="Berlin", remote=True, salary_min="80000",
|
||||
salary_max=95000, currency="EUR", department="Eng"))
|
||||
|
||||
Reference in new issue
Block a user